mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
Swarm http api, shed, pss: fixed ineff got, err assigns in unit tests.
This commit is contained in:
parent
f32790fb05
commit
8daf486355
2 changed files with 7 additions and 7 deletions
|
|
@ -40,7 +40,7 @@ func TestError(t *testing.T) {
|
|||
t.Fatalf("Request failed: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
respbody, err = ioutil.ReadAll(resp.Body)
|
||||
respbody, _ = ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != 404 && !strings.Contains(string(respbody), "Invalid URI "/this_should_fail_as_no_bzz_protocol_present": unknown scheme") {
|
||||
t.Fatalf("Response body does not match, expected: %v, to contain: %v; received code %d, expected code: %d", string(respbody), "Invalid bzz URI: unknown scheme", 400, resp.StatusCode)
|
||||
|
|
@ -66,7 +66,7 @@ func Test404Page(t *testing.T) {
|
|||
t.Fatalf("Request failed: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
respbody, err = ioutil.ReadAll(resp.Body)
|
||||
respbody, _ = ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != 404 || !strings.Contains(string(respbody), "404") {
|
||||
t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode)
|
||||
|
|
@ -92,7 +92,7 @@ func Test500Page(t *testing.T) {
|
|||
t.Fatalf("Request failed: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
respbody, err = ioutil.ReadAll(resp.Body)
|
||||
respbody, _ = ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != 404 {
|
||||
t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode)
|
||||
|
|
@ -117,7 +117,7 @@ func Test500PageWith0xHashPrefix(t *testing.T) {
|
|||
t.Fatalf("Request failed: %v", err)
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
respbody, err = ioutil.ReadAll(resp.Body)
|
||||
respbody, _ = ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != 404 {
|
||||
t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode)
|
||||
|
|
@ -152,7 +152,7 @@ func TestJsonResponse(t *testing.T) {
|
|||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
respbody, err = ioutil.ReadAll(resp.Body)
|
||||
respbody, _ = ioutil.ReadAll(resp.Body)
|
||||
|
||||
if resp.StatusCode != 404 {
|
||||
t.Fatalf("Invalid Status Code received, expected 404, got %d", resp.StatusCode)
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ func TestIndex(t *testing.T) {
|
|||
}
|
||||
|
||||
wantErr := leveldb.ErrNotFound
|
||||
got, err = index.Get(IndexItem{
|
||||
_, err = index.Get(IndexItem{
|
||||
Address: want.Address,
|
||||
})
|
||||
if err != wantErr {
|
||||
|
|
@ -241,7 +241,7 @@ func TestIndex(t *testing.T) {
|
|||
}
|
||||
|
||||
wantErr := leveldb.ErrNotFound
|
||||
got, err = index.Get(IndexItem{
|
||||
_, err = index.Get(IndexItem{
|
||||
Address: want.Address,
|
||||
})
|
||||
if err != wantErr {
|
||||
|
|
|
|||
Loading…
Reference in a new issue