Swarm http api, shed, pss: fixed ineff got, err assigns in unit tests.

This commit is contained in:
Mitsuko Megumi 2018-12-08 00:38:57 -05:00
parent f32790fb05
commit 8daf486355
No known key found for this signature in database
GPG key ID: 4B423FB1AE06E5C6
2 changed files with 7 additions and 7 deletions

View file

@ -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)

View file

@ -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 {