address test & doc comments

This commit is contained in:
Josh Horwitz
2017-08-25 16:15:55 -04:00
parent 2f1ea47c83
commit 3528ceb27f
10 changed files with 14 additions and 5 deletions

View File

@@ -130,23 +130,23 @@ func TestEnsureNodeExistsByProviderIDOrNodeName(t *testing.T) {
instances, _ := fc.Instances()
exists, err := ensureNodeExistsByProviderIDOrName(instances, tc.node)
if err != nil {
t.Fatal(err)
t.Error(err)
}
if !reflect.DeepEqual(fc.Calls, tc.expectedCalls) {
t.Fatalf("expected cloud provider methods `%v` to be called but `%v` was called ", tc.expectedCalls, fc.Calls)
t.Errorf("expected cloud provider methods `%v` to be called but `%v` was called ", tc.expectedCalls, fc.Calls)
}
if tc.existsByProviderID && tc.existsByProviderID != exists {
t.Fatalf("expected exist by provider id to be `%t` but got `%t`", tc.existsByProviderID, exists)
t.Errorf("expected exist by provider id to be `%t` but got `%t`", tc.existsByProviderID, exists)
}
if tc.existsByNodeName && tc.existsByNodeName != exists {
t.Fatalf("expected exist by node name to be `%t` but got `%t`", tc.existsByNodeName, exists)
t.Errorf("expected exist by node name to be `%t` but got `%t`", tc.existsByNodeName, exists)
}
if !tc.existsByNodeName && !tc.existsByProviderID && exists {
t.Fatal("node is not supposed to exist")
t.Error("node is not supposed to exist")
}
})