From de01b8773b7a97092ed07a671b477fbdbda3e78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 23 Jul 2020 11:38:43 +0200 Subject: [PATCH] update TestCreateAccountInvalidUserName MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- pkg/proto/v0/accounts.pb.micro_test.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pkg/proto/v0/accounts.pb.micro_test.go b/pkg/proto/v0/accounts.pb.micro_test.go index a43056c33d..0251a4f65f 100644 --- a/pkg/proto/v0/accounts.pb.micro_test.go +++ b/pkg/proto/v0/accounts.pb.micro_test.go @@ -389,6 +389,11 @@ func TestCreateExistingUser(t *testing.T) { // All tests fail after running this // https://github.com/owncloud/ocis-accounts/issues/62 func TestCreateAccountInvalidUserName(t *testing.T) { + + resp, err := listAccounts(t) + checkError(t, err) + numAccounts := len(resp.GetAccounts()) + testData := []string{ "", "0", @@ -403,11 +408,11 @@ func TestCreateAccountInvalidUserName(t *testing.T) { checkError(t, err) } - // This throws a error in server - // resp contains no accounts - resp, _ := listAccounts(t) + // resp should have the same number of accounts + resp, err = listAccounts(t) + checkError(t, err) - assert.Equal(t, 0, len(resp.GetAccounts())) + assert.Equal(t, numAccounts, len(resp.GetAccounts())) cleanUp(t) }