Skip to content

Commit

Permalink
Add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
N-o-Z committed Jan 21, 2025
1 parent 500b7b5 commit 483cd39
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions pkg/api/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3403,16 +3403,19 @@ func TestController_LogAction(t *testing.T) {
func TestController_ConfigHandlers(t *testing.T) {
clt, deps := setupClientWithAdmin(t)
ctx := context.Background()
expectedExample := onBlock(deps, "example-bucket/")

t.Run("Get config", func(t *testing.T) {
resp, err := clt.GetConfigWithResponse(ctx)
verifyResponseOK(t, resp, err)
require.Empty(t, resp.JSON200.StorageConfigList)
require.Equal(t, expectedExample, resp.JSON200.StorageConfig.BlockstoreNamespaceExample)
})

t.Run("Get storage config", func(t *testing.T) {
ExpectedExample := onBlock(deps, "example-bucket/")
resp, err := clt.GetStorageConfigWithResponse(ctx)
verifyResponseOK(t, resp, err)

example := resp.JSON200.BlockstoreNamespaceExample
if example != ExpectedExample {
t.Errorf("expected to get %s, got %s", ExpectedExample, example)
}
require.Equal(t, expectedExample, resp.JSON200.BlockstoreNamespaceExample)
})

t.Run("Get gc config", func(t *testing.T) {
Expand Down

0 comments on commit 483cd39

Please sign in to comment.