Fix tests.

This commit is contained in:
Tom Wilkie
2015-08-18 10:47:36 +00:00
parent a86d47deb0
commit 819cfdfbdd

View File

@@ -67,13 +67,13 @@ func TestAPITopologyApplications(t *testing.T) {
defer ts.Close()
is404(t, ts, "/api/topology/applications/foobar")
{
body := getRawJSON(t, ts, "/api/topology/applications")
body := getRawJSON(t, ts, "/api/topology/containers")
var topo APITopology
if err := json.Unmarshal(body, &topo); err != nil {
t.Fatal(err)
}
if want, have := render.OnlyConnected(expected.RenderedProcesses), fixNodeMetadatas(topo.Nodes); !reflect.DeepEqual(want, have) {
if want, have := expected.RenderedContainers, fixNodeMetadatas(topo.Nodes); !reflect.DeepEqual(want, have) {
t.Error(test.Diff(want, have))
}
}
@@ -85,7 +85,7 @@ func TestAPITopologyApplications(t *testing.T) {
}
equals(t, expected.ServerProcessID, node.Node.ID)
equals(t, "apache", node.Node.LabelMajor)
equals(t, fmt.Sprintf("%s (%s)", test.ServerHostID, test.ServerPID), node.Node.LabelMinor)
equals(t, fmt.Sprintf("%s (server:%s)", test.ServerHostID, test.ServerPID), node.Node.LabelMinor)
equals(t, false, node.Node.Pseudo)
// Let's not unit-test the specific content of the detail tables
}