testing

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

roles unit tests

Index

Constants

View Source
const CreateRequest = `` /* 131-byte string literal not displayed */

CreateRequest provides the input to a Create request.

View Source
const GetOutput = `` /* 285-byte string literal not displayed */

GetOutput provides a Get result.

View Source
const ListAssignmentOutput = `` /* 1086-byte string literal not displayed */
View Source
const ListOutput = `` /* 750-byte string literal not displayed */

ListOutput provides a single page of Role results.

View Source
const UpdateOutput = `` /* 291-byte string literal not displayed */

UpdateOutput provides an update result.

View Source
const UpdateRequest = `
{
    "role": {
        "description": "admin read-only support role"
    }
}
`

UpdateRequest provides the input to as Update request.

Variables

ExpectedRoleAssignmentsSlice is the slice of role assignments expected to be returned from ListAssignmentOutput.

View Source
var ExpectedRolesSlice = []roles.Role{FirstRole, SecondRole}

ExpectedRolesSlice is the slice of roles expected to be returned from ListOutput.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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 HandleAssignSuccessfully

func HandleAssignSuccessfully(t *testing.T)

func HandleCreateRoleSuccessfully

func HandleCreateRoleSuccessfully(t *testing.T)

HandleCreateRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that tests role creation.

func HandleDeleteRoleSuccessfully

func HandleDeleteRoleSuccessfully(t *testing.T)

HandleDeleteRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that tests role deletion.

func HandleGetRoleSuccessfully

func HandleGetRoleSuccessfully(t *testing.T)

HandleGetRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that responds with a single role.

func HandleListRoleAssignmentsSuccessfully

func HandleListRoleAssignmentsSuccessfully(t *testing.T)

HandleListRoleAssignmentsSuccessfully creates an HTTP handler at `/role_assignments` on the test handler mux that responds with a list of two role assignments.

func HandleListRolesSuccessfully

func HandleListRolesSuccessfully(t *testing.T)

HandleListRolesSuccessfully creates an HTTP handler at `/roles` on the test handler mux that responds with a list of two roles.

func HandleUnassignSuccessfully

func HandleUnassignSuccessfully(t *testing.T)

func HandleUpdateRoleSuccessfully

func HandleUpdateRoleSuccessfully(t *testing.T)

HandleUpdateRoleSuccessfully creates an HTTP handler at `/roles` on the test handler mux that tests role update.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL