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 HandleListAssignmentsOnResourceSuccessfully_DomainsGroups(t *testing.T)
- func HandleListAssignmentsOnResourceSuccessfully_DomainsUsers(t *testing.T)
- func HandleListAssignmentsOnResourceSuccessfully_ProjectsGroups(t *testing.T)
- func HandleListAssignmentsOnResourceSuccessfully_ProjectsUsers(t *testing.T)
- func HandleListRoleAssignmentsSuccessfully(t *testing.T)
- func HandleListRoleAssignmentsWithNamesSuccessfully(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 = `` /* 1338-byte string literal not displayed */
ListAssignmentOutput provides a result of ListAssignment request.
const ListAssignmentWithNamesOutput = `` /* 843-byte string literal not displayed */
ListAssignmentWithNamesOutput provides a result of ListAssignment request with IncludeNames option.
const ListAssignmentsOnResourceOutput = `` /* 461-byte string literal not displayed */
ListAssignmentsOnResourceOutput provides a result of ListAssignmentsOnResource request.
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 ExpectedRoleAssignmentsWithNamesSlice = []roles.RoleAssignment{ThirdRoleAssignment}
ExpectedRoleAssignmentsWithNamesSlice is the slice of role assignments expected to be returned from ListAssignmentWithNamesOutput.
var ExpectedRolesOnResourceSlice = []roles.Role{RoleOnResource}
ExpectedRolesOnResourceSlice is the slice of roles expected to be returned from ListAssignmentsOnResourceOutput.
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{ Role: roles.AssignedRole{ID: "123456"}, Scope: roles.Scope{Domain: roles.Domain{ID: "161718"}}, User: roles.User{Domain: roles.Domain{ID: "161718"}, ID: "313233"}, Group: roles.Group{}, }
FirstRoleAssignment is the first role assignment in the List request.
var RoleOnResource = roles.Role{ 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", }, }
RoleOnResource is the role in the ListAssignmentsOnResource 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{ Role: roles.AssignedRole{ID: "123456"}, Scope: roles.Scope{Project: roles.Project{Domain: roles.Domain{ID: "161718"}, ID: "456789"}}, User: roles.User{Domain: roles.Domain{ID: "161718"}, ID: "313233"}, Group: roles.Group{}, }
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.
var ThirdRoleAssignment = roles.RoleAssignment{ Role: roles.AssignedRole{ID: "123456", Name: "include_names_role"}, Scope: roles.Scope{Domain: roles.Domain{ID: "161718", Name: "52833"}}, User: roles.User{Domain: roles.Domain{ID: "161718", Name: "52833"}, ID: "313233", Name: "example-user-name"}, Group: roles.Group{}, }
ThirdRoleAssignment is the third role assignment that has entity names in the List request.
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 HandleListRoleAssignmentsWithNamesSuccessfully ¶
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.