make testclient more precise

This commit is contained in:
deads2k
2015-08-03 09:21:11 -04:00
parent 4271f28548
commit 182885e897
33 changed files with 1004 additions and 401 deletions

View File

@@ -199,11 +199,11 @@ func TestServiceAccountCreation(t *testing.T) {
}
for i, expectedName := range tc.ExpectCreatedServiceAccounts {
action := actions[i]
if action.Action != "create-serviceaccount" {
t.Errorf("%s: Unexpected action %s", k, action.Action)
if !action.Matches("create", "serviceaccounts") {
t.Errorf("%s: Unexpected action %s", k, action)
break
}
createdAccount := action.Value.(*api.ServiceAccount)
createdAccount := action.(testclient.CreateAction).GetObject().(*api.ServiceAccount)
if createdAccount.Name != expectedName {
t.Errorf("%s: Expected %s to be created, got %s", k, expectedName, createdAccount.Name)
}