testing

package
v0.0.0-...-56e5f01 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

trusts unit tests

Index

Constants

View Source
const CreateRequest = `` /* 414-byte string literal not displayed */
View Source
const CreateRequestNoExpire = `` /* 368-byte string literal not displayed */
View Source
const CreateResponse = `` /* 713-byte string literal not displayed */
View Source
const CreateResponseNoExpire = `` /* 660-byte string literal not displayed */
View Source
const GetResponse = `` /* 762-byte string literal not displayed */

GetOutput provides a Get result.

View Source
const GetTrustRoleResponse = `` /* 171-byte string literal not displayed */
View Source
const ListResponse = `` /* 723-byte string literal not displayed */

ListOutput provides a single page of Role results.

View Source
const ListTrustRolesResponse = `` /* 398-byte string literal not displayed */

Variables

View Source
var CreatedTrust = trusts.Trust{
	ID:                "3422b7c113894f5d90665e1a79655e23",
	Impersonation:     false,
	TrusteeUserID:     "ecb37e88cc86431c99d0332208cb6fbf",
	TrustorUserID:     "959ed913a32c4ec88c041c98e61cbbc3",
	ProjectID:         "9b71012f5a4a4aef9193f1995fe159b2",
	ExpiresAt:         time.Date(2019, 12, 01, 14, 00, 00, 0, time.UTC),
	DeletedAt:         time.Time{},
	RedelegationCount: 10,
	Roles: []trusts.Role{
		{
			ID:   "b627fca5-beb0-471a-9857-0e852b719e76",
			Name: "member",
		},
	},
}
View Source
var CreatedTrustNoExpire = trusts.Trust{
	ID:                "3422b7c113894f5d90665e1a79655e23",
	Impersonation:     false,
	TrusteeUserID:     "ecb37e88cc86431c99d0332208cb6fbf",
	TrustorUserID:     "959ed913a32c4ec88c041c98e61cbbc3",
	ProjectID:         "9b71012f5a4a4aef9193f1995fe159b2",
	DeletedAt:         time.Time{},
	RedelegationCount: 10,
	Roles: []trusts.Role{
		{
			ID:   "b627fca5-beb0-471a-9857-0e852b719e76",
			Name: "member",
		},
	},
}
View Source
var ExpectedTrustRolesSlice = []trusts.Role{FirstRole, SecondRole}
View Source
var ExpectedTrustsSlice = []trusts.Trust{FirstTrust, SecondTrust}

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

View Source
var FirstRole = trusts.Role{
	ID:   "c1648e",
	Name: "manager",
}
View Source
var FirstTrust = trusts.Trust{
	ID:            "1ff900",
	Impersonation: true,
	TrusteeUserID: "86c0d5",
	TrustorUserID: "a0fdfd",
	ProjectID:     "0f1233",
	ExpiresAt:     time.Date(2019, 12, 01, 14, 00, 00, 0, time.UTC),
	DeletedAt:     time.Time{},
}
View Source
var SecondRole = trusts.Role{
	ID:   "ed7b78",
	Name: "member",
}
View Source
var SecondTrust = trusts.Trust{
	ID:            "f4513a",
	Impersonation: false,
	TrusteeUserID: "86c0d5",
	TrustorUserID: "3cd2ce",
	ProjectID:     "0f1233",
	ExpiresAt:     time.Time{},
	DeletedAt:     time.Time{},
}

Functions

func HandleCheckTrustRoleSuccessfully

func HandleCheckTrustRoleSuccessfully(t *testing.T)

HandleCheckTrustRoleSuccessfully creates an HTTP handler at `/OS-TRUST/trusts/987fe8/roles/c1648e` on the test handler mux that responds with a list trust roles.

func HandleCreateTokenWithTrustID

func HandleCreateTokenWithTrustID(t *testing.T, options tokens.AuthOptionsBuilder, requestJSON string)

HandleCreateTokenWithTrustID verifies that providing certain AuthOptions and Scope results in an expected JSON structure.

func HandleCreateTrust

func HandleCreateTrust(t *testing.T)

HandleCreateTrust creates an HTTP handler at `/OS-TRUST/trusts` on the test handler mux that tests trust creation.

func HandleCreateTrustNoExpire

func HandleCreateTrustNoExpire(t *testing.T)

HandleCreateTrustNoExpire creates an HTTP handler at `/OS-TRUST/trusts` on the test handler mux that tests trust creation.

func HandleDeleteTrust

func HandleDeleteTrust(t *testing.T)

HandleDeleteUserSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests user deletion.

func HandleGetTrustRoleSuccessfully

func HandleGetTrustRoleSuccessfully(t *testing.T)

HandleGetTrustRoleSuccessfully creates an HTTP handler at `/OS-TRUST/trusts/987fe8/roles/c1648e` on the test handler mux that responds with a trust role details.

func HandleGetTrustSuccessfully

func HandleGetTrustSuccessfully(t *testing.T)

HandleGetTrustSuccessfully creates an HTTP handler at `/OS-TRUST/trusts` on the test handler mux that responds with a single trusts.

func HandleListTrustRolesSuccessfully

func HandleListTrustRolesSuccessfully(t *testing.T)

HandleListTrustRolesSuccessfully creates an HTTP handler at `/OS-TRUST/trusts/987fe8/roles` on the test handler mux that responds with a list trust roles.

func HandleListTrustsSuccessfully

func HandleListTrustsSuccessfully(t *testing.T)

HandleListTrustsSuccessfully creates an HTTP handler at `/OS-TRUST/trusts` on the test handler mux that responds with a list of two trusts.

Types

This section is empty.

Jump to

Keyboard shortcuts

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