Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnester committed Nov 28, 2024
1 parent 12da48c commit bc4c9ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bundle/permissions/mutator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func TestApplyBundlePermissions(t *testing.T) {
"endpoint_1": {},
"endpoint_2": {},
},
Dashboards: map[string]*resources.Dashboard{
"dashboard_1": {},
"dashboard_2": {},
},
Apps: map[string]*resources.App{
"app_1": {},
"app_2": {},
Expand Down Expand Up @@ -108,6 +112,10 @@ func TestApplyBundlePermissions(t *testing.T) {
require.Contains(t, b.Config.Resources.ModelServingEndpoints["endpoint_2"].Permissions, resources.Permission{Level: "CAN_VIEW", GroupName: "TestGroup"})
require.Contains(t, b.Config.Resources.ModelServingEndpoints["endpoint_2"].Permissions, resources.Permission{Level: "CAN_QUERY", ServicePrincipalName: "TestServicePrincipal"})

require.Len(t, b.Config.Resources.Dashboards["dashboard_1"].Permissions, 2)
require.Contains(t, b.Config.Resources.Dashboards["dashboard_1"].Permissions, resources.Permission{Level: "CAN_MANAGE", UserName: "TestUser"})
require.Contains(t, b.Config.Resources.Dashboards["dashboard_1"].Permissions, resources.Permission{Level: "CAN_READ", GroupName: "TestGroup"})

require.Len(t, b.Config.Resources.Apps["app_1"].Permissions, 2)
require.Contains(t, b.Config.Resources.Apps["app_1"].Permissions, resources.Permission{Level: "CAN_MANAGE", UserName: "TestUser"})
require.Contains(t, b.Config.Resources.Apps["app_1"].Permissions, resources.Permission{Level: "CAN_USE", GroupName: "TestGroup"})
Expand Down

0 comments on commit bc4c9ac

Please sign in to comment.