Skip to content

Commit

Permalink
another failure case
Browse files Browse the repository at this point in the history
  • Loading branch information
MatousJobanek committed Apr 18, 2024
1 parent f8b5328 commit 6b8b732
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/cmd/generate/nstemplatetiers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,19 @@ func TestGenerateNSTemplateTiers(t *testing.T) {
require.Error(t, err)
assert.Equal(t, "lstat /does/not/exist: no such file or directory", err.Error()) // error occurred while creating TierTemplate resources
})

t.Run("failed to process wrong files", func(t *testing.T) {
// given
outTempDir, err := os.MkdirTemp("", "generate-tiers-test-")
require.NoError(t, err)

// when
err = NSTemplateTiers(term, "../../../test-resources/dummy.openshiftapps.com/", outTempDir, commontest.HostOperatorNs)

// then
require.Error(t, err)
assert.Contains(t, err.Error(), "../../../test-resources/dummy.openshiftapps.com/")
})
}

type templateRefs struct {
Expand Down

0 comments on commit 6b8b732

Please sign in to comment.