Skip to content

Commit

Permalink
Fix other test
Browse files Browse the repository at this point in the history
  • Loading branch information
jjacobson93 committed Aug 3, 2023
1 parent cfec746 commit 8a9db4c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions command/acl/acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,12 @@ func Test_GetPolicyIDFromPartial_Builtins(t *testing.T) {
client := a.Client()
client.AddHeader("X-Consul-Token", "root")

t.Run("global management policy", func(t *testing.T) {
id, err := GetPolicyIDFromPartial(client, structs.ACLPolicyGlobalManagementName)
require.NoError(t, err)
require.Equal(t, structs.ACLPolicyGlobalManagementID, id)
})

t.Run("global read-only policy", func(t *testing.T) {
id, err := GetPolicyIDFromPartial(client, structs.ACLPolicyGlobalReadOnlyName)
require.NoError(t, err)
require.Equal(t, structs.ACLPolicyGlobalReadOnlyID, id)
})
for _, policy := range structs.ACLBuiltinPolicies {
name := fmt.Sprintf("%s policy", policy.Name)
t.Run(name, func(t *testing.T) {
id, err := GetPolicyIDFromPartial(client, policy.Name)
require.NoError(t, err)
require.Equal(t, policy.ID, id)
})
}
}

0 comments on commit 8a9db4c

Please sign in to comment.