Skip to content

Commit

Permalink
Add missing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz-Smelcerz-SAP committed Jan 2, 2025
1 parent 5e613fd commit 7cdbfdb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions maintenancewindows/resolver/resolver_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package resolver

import (
"os"
"testing"

"github.com/stretchr/testify/assert"
)

func TestGetMaintenancePolicyPool(t *testing.T) {
err := os.Setenv(policyPathENV, "./testdata")
assert.NoError(t, err)

pool, err := GetMaintenancePolicyPool()
assert.NoError(t, err)

assert.Equal(t, 2, len(pool))
assert.Contains(t, pool, "ruleset-1.json")
assert.Contains(t, pool, "ruleset-2.json")

data1 := pool["ruleset-1.json"]
data2 := pool["ruleset-2.json"]
assert.NotNil(t, data1)
assert.NotNil(t, data2)
}

0 comments on commit 7cdbfdb

Please sign in to comment.