Documentation ¶
Overview ¶
roles unit tests
Index ¶
- Constants
- Variables
- func HandleAssignSuccessfully(t *testing.T)
- func HandleCreateRoleSuccessfully(t *testing.T)
- func HandleDeleteRoleSuccessfully(t *testing.T)
- func HandleGetRoleSuccessfully(t *testing.T)
- func HandleListRoleAssignmentsSuccessfully(t *testing.T)
- func HandleListRolesSuccessfully(t *testing.T)
- func HandleUnassignSuccessfully(t *testing.T)
- func HandleUpdateRoleSuccessfully(t *testing.T)
Constants ¶
const CreateRequest = `` /* 131-byte string literal not displayed */
CreateRequest provides the input to a Create request.
const GetOutput = `` /* 285-byte string literal not displayed */
GetOutput provides a Get result.
const ListAssignmentOutput = `` /* 1086-byte string literal not displayed */
const ListOutput = `` /* 750-byte string literal not displayed */
ListOutput provides a single page of Role results.
const UpdateOutput = `` /* 291-byte string literal not displayed */
UpdateOutput provides an update result.
const UpdateRequest = `
{
"role": {
"description": "admin read-only support role"
}
}
`
UpdateRequest provides the input to as Update request.
Variables ¶
var ExpectedRoleAssignmentsSlice = []roles.RoleAssignment{FirstRoleAssignment, SecondRoleAssignment}
ExpectedRoleAssignmentsSlice is the slice of role assignments expected to be returned from ListAssignmentOutput.
var ExpectedRolesSlice = []roles.Role{FirstRole, SecondRole}
ExpectedRolesSlice is the slice of roles expected to be returned from ListOutput.
var FirstRole = roles.Role{ DomainID: "default", ID: "2844b2a08be147a08ef58317d6471f1f", Links: map[string]interface{}{ "self": "http://example.com/identity/v3/roles/2844b2a08be147a08ef58317d6471f1f", }, Name: "admin-read-only", Extra: map[string]interface{}{}, }
FirstRole is the first role in the List request.
var FirstRoleAssignment = roles.RoleAssignment{ Catalog: "BASE", Description: "Tenant Administrator", DisplayName: "Tenant Administrator", ID: "699bd62cda304d2cad03fd2fb190b8cf", Name: "te_admin", Type: "AA", Policy: roles.Policy{ Statement: []roles.Statement{}, Version: "v1", }, }
FirstRoleAssignment is the first role assignment in the List request.
var SecondRole = roles.Role{ DomainID: "1789d1", ID: "9fe1d3", Links: map[string]interface{}{ "self": "https://example.com/identity/v3/roles/9fe1d3", }, Name: "support", Extra: map[string]interface{}{ "description": "read-only support role", }, }
SecondRole is the second role in the List request.
var SecondRoleAssignment = roles.RoleAssignment{ Catalog: "BASE", Description: "Security Administrator", DisplayName: "Security Administrator", ID: "699bd62cda304d2cad03fd2fb190b8ce", Name: "secu_admin", Type: "AA", Policy: roles.Policy{ Statement: []roles.Statement{}, Version: "v1", }, }
SecondRoleAssignemnt is the second role assignemnt in the List request.
var SecondRoleUpdated = roles.Role{ DomainID: "1789d1", ID: "9fe1d3", Links: map[string]interface{}{ "self": "https://example.com/identity/v3/roles/9fe1d3", }, Name: "support", Extra: map[string]interface{}{ "description": "admin read-only support role", }, }
SecondRoleUpdated is how SecondRole should look after an Update.
Functions ¶
func HandleCreateRoleSuccessfully ¶
HandleCreateRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that tests role creation.
func HandleDeleteRoleSuccessfully ¶
HandleDeleteRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that tests role deletion.
func HandleGetRoleSuccessfully ¶
HandleGetRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that responds with a single role.
func HandleListRoleAssignmentsSuccessfully ¶
HandleListRoleAssignmentsSuccessfully creates an HTTP handler at `/role_assignments` on the test handler mux that responds with a list of two role assignments.
func HandleListRolesSuccessfully ¶
HandleListRolesSuccessfully creates an HTTP handler at `/roles` on the test handler mux that responds with a list of two roles.
func HandleUpdateRoleSuccessfully ¶
HandleUpdateRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that tests role update.
Types ¶
This section is empty.