update TestCreateAccountInvalidUserName

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2020-07-23 11:38:43 +02:00
parent bf3581c914
commit de01b8773b
+9 -4
View File
@@ -389,6 +389,11 @@ func TestCreateExistingUser(t *testing.T) {
// All tests fail after running this // All tests fail after running this
// https://github.com/owncloud/ocis-accounts/issues/62 // https://github.com/owncloud/ocis-accounts/issues/62
func TestCreateAccountInvalidUserName(t *testing.T) { func TestCreateAccountInvalidUserName(t *testing.T) {
resp, err := listAccounts(t)
checkError(t, err)
numAccounts := len(resp.GetAccounts())
testData := []string{ testData := []string{
"", "",
"0", "0",
@@ -403,11 +408,11 @@ func TestCreateAccountInvalidUserName(t *testing.T) {
checkError(t, err) checkError(t, err)
} }
// This throws a error in server // resp should have the same number of accounts
// resp contains no accounts resp, err = listAccounts(t)
resp, _ := listAccounts(t) checkError(t, err)
assert.Equal(t, 0, len(resp.GetAccounts())) assert.Equal(t, numAccounts, len(resp.GetAccounts()))
cleanUp(t) cleanUp(t)
} }