From 54466ff46c89fe26357938efd16af9dacc8a17d6 Mon Sep 17 00:00:00 2001 From: Juliano Martinez Date: Mon, 4 Dec 2023 21:33:56 +0100 Subject: [PATCH] more tests --- pkg/aclmanager/aclmanager_test.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/aclmanager/aclmanager_test.go b/pkg/aclmanager/aclmanager_test.go index 9c08870..3a70141 100644 --- a/pkg/aclmanager/aclmanager_test.go +++ b/pkg/aclmanager/aclmanager_test.go @@ -174,6 +174,15 @@ func TestListAcls(t *testing.T) { } } +func TestListAcls_Error(t *testing.T) { + redisClient, mock := redismock.NewClientMock() + + // Mocking the response for the ACL LIST command + mock.ExpectDo("ACL", "LIST").SetVal([]string{"user acl1", "user acl2"}) + _, err := listAcls(context.Background(), redisClient) + assert.Error(t, err) +} + func TestMirrorAcls(t *testing.T) { tests := []struct { name string @@ -316,7 +325,7 @@ func TestNewAclManager(t *testing.T) { } } -func TestCurrentFunctionError(t *testing.T) { +func TestCurrentFunction_Error(t *testing.T) { redisClient, mock := redismock.NewClientMock() // Mocking the response for the Info function