|
|
@ -124,6 +124,7 @@ func TestMocker(t *testing.T) { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
t.Fatalf("Could not start mocker: %s", err) |
|
|
|
t.Fatalf("Could not start mocker: %s", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resp.Body.Close() |
|
|
|
if resp.StatusCode != 200 { |
|
|
|
if resp.StatusCode != 200 { |
|
|
|
t.Fatalf("Invalid Status Code received for starting mocker, expected 200, got %d", resp.StatusCode) |
|
|
|
t.Fatalf("Invalid Status Code received for starting mocker, expected 200, got %d", resp.StatusCode) |
|
|
|
} |
|
|
|
} |
|
|
@ -145,15 +146,17 @@ func TestMocker(t *testing.T) { |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
t.Fatalf("Could not stop mocker: %s", err) |
|
|
|
t.Fatalf("Could not stop mocker: %s", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resp.Body.Close() |
|
|
|
if resp.StatusCode != 200 { |
|
|
|
if resp.StatusCode != 200 { |
|
|
|
t.Fatalf("Invalid Status Code received for stopping mocker, expected 200, got %d", resp.StatusCode) |
|
|
|
t.Fatalf("Invalid Status Code received for stopping mocker, expected 200, got %d", resp.StatusCode) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//reset the network
|
|
|
|
//reset the network
|
|
|
|
_, err = http.Post(s.URL+"/reset", "", nil) |
|
|
|
resp, err = http.Post(s.URL+"/reset", "", nil) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
t.Fatalf("Could not reset network: %s", err) |
|
|
|
t.Fatalf("Could not reset network: %s", err) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
resp.Body.Close() |
|
|
|
|
|
|
|
|
|
|
|
//now the number of nodes in the network should be zero
|
|
|
|
//now the number of nodes in the network should be zero
|
|
|
|
nodesInfo, err = client.GetNodes() |
|
|
|
nodesInfo, err = client.GetNodes() |
|
|
|