Fix other test

pull/18347/head
Jeremy Jacobson 2023-08-03 12:52:42 -07:00
parent cfec746d8b
commit 8a9db4cffc
1 changed files with 8 additions and 11 deletions

View File

@ -72,15 +72,12 @@ func Test_GetPolicyIDFromPartial_Builtins(t *testing.T) {
client := a.Client() client := a.Client()
client.AddHeader("X-Consul-Token", "root") client.AddHeader("X-Consul-Token", "root")
t.Run("global management policy", func(t *testing.T) { for _, policy := range structs.ACLBuiltinPolicies {
id, err := GetPolicyIDFromPartial(client, structs.ACLPolicyGlobalManagementName) 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.NoError(t, err)
require.Equal(t, structs.ACLPolicyGlobalManagementID, id) require.Equal(t, policy.ID, 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)
}) })
}
} }