Skip to content

Commit

Permalink
Added a missing test for
Browse files Browse the repository at this point in the history
  • Loading branch information
ilijamt committed Sep 1, 2023
1 parent 0e43674 commit 9065af9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions path_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ func TestPathConfig(t *testing.T) {
require.EqualValues(t, resp.Error(), gitlab.ErrBackendNotConfigured)
})

t.Run("deleting uninitialized config should return error", func(t *testing.T) {
b, l, err := getBackend()
require.NoError(t, err)
resp, err := b.HandleRequest(context.Background(), &logical.Request{
Operation: logical.DeleteOperation,
Path: gitlab.PathConfigStorage, Storage: l,
})
require.NoError(t, err)
require.NotNil(t, resp)
require.Error(t, resp.Error())
require.True(t, resp.IsError())
require.EqualValues(t, resp.Error(), gitlab.ErrBackendNotConfigured)
})

t.Run("write, read, delete and read config", func(t *testing.T) {
b, l, events, err := getBackendWithEvents()
require.NoError(t, err)
Expand Down

0 comments on commit 9065af9

Please sign in to comment.