Exemplo n.º 1
0
func TestServicedCLI_CmdHostList_one(t *testing.T) {
	hostID := "test-host-id-1"

	expected, err := DefaultHostAPITest.GetHost(hostID)
	if err != nil {
		t.Fatal(err)
	}

	var actual host.Host
	output := pipe(InitHostAPITest, "serviced", "host", "list", "test-host-id-1")
	if err := json.Unmarshal(output, &actual); err != nil {
		t.Fatalf("error unmarshaling resource: %s", err)
	}

	// Did you remember to update Host.Equals?
	if !actual.Equals(expected) {
		t.Fatalf("\ngot:\n%+v\nwant:\n%+v", actual, expected)
	}
}