Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrancisc committed Feb 27, 2024
1 parent 4263bea commit 27db30c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/templates/toolchaincluster/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ func TestGetRoleTemplate(t *testing.T) {
t.Run("error reading template", func(t *testing.T) {
// when
// we pass an invalid template path
sa, err := GetRoleFromTemplate(&deploy.ToolchainClusterTemplateFS, "host-role-invalid.yaml", &rbac.Role{})
role, err := GetRoleFromTemplate(&deploy.ToolchainClusterTemplateFS, "host-role-invalid.yaml", &rbac.Role{})
// then
require.Error(t, err)
require.Nil(t, sa)
require.Nil(t, role)
})

t.Run("no role found", func(t *testing.T) {
// when
// we pass a template that contains a different Kind
sa, err := GetRoleFromTemplate(&deploy.ToolchainClusterTemplateFS, "host-sa.yaml", &rbac.Role{})
role, err := GetRoleFromTemplate(&deploy.ToolchainClusterTemplateFS, "host-sa.yaml", &rbac.Role{})
// then
require.Nil(t, err)
require.Nil(t, sa)
require.Nil(t, role)
})
}

Expand Down

0 comments on commit 27db30c

Please sign in to comment.