testing

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 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{
	Role:  roles.AssignedRole{ID: "123456"},
	Scope: roles.Scope{Domain: roles.Domain{ID: "161718"}},
	User:  roles.User{ID: "313233"},
	Group: roles.Group{},
}

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{
	Role:  roles.AssignedRole{ID: "123456"},
	Scope: roles.Scope{Project: roles.Project{ID: "456789"}},
	User:  roles.User{ID: "313233"},
	Group: roles.Group{},
}

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