testing

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ChangePasswordRequest = `
{
    "user": {
        "password": "new_secretsecret",
        "original_password": "secretsecret"
    }
}
`

ChangePasswordRequest provides the input to a ChangePassword request.

View Source
const CreateNoOptionsRequest = `` /* 221-byte string literal not displayed */

CreateNoOptionsRequest provides the input to a Create request with no Options.

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

CreateRequest provides the input to a Create request.

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

GetOutput provides a Get result.

View Source
const GetOutputNoOptions = `` /* 367-byte string literal not displayed */

GetOutputNoOptions provides a Get result of a user with no options.

View Source
const ListGroupsOutput = `` /* 822-byte string literal not displayed */

ListGroupsOutput provides a ListGroups result.

View Source
const ListOutput = `` /* 1214-byte string literal not displayed */

ListOutput provides a single page of User results.

View Source
const ListProjectsOutput = `` /* 847-byte string literal not displayed */

ListProjectsOutput provides a ListProjects result.

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

UpdateOutput provides an update result.

View Source
const UpdateRequest = `` /* 161-byte string literal not displayed */

UpdateRequest provides the input to an Update request.

Variables

View Source
var ExpectedGroupsSlice = []groups.Group{FirstGroup, SecondGroup}
View Source
var ExpectedProjectsSlice = []projects.Project{FirstProject, SecondProject}
View Source
var ExpectedUsersSlice = []users.User{FirstUser, SecondUser}

ExpectedUsersSlice is the slice of users expected to be returned from ListOutput.

View Source
var FirstGroup = groups.Group{
	Description: "Developers cleared for work on all general projects",
	DomainID:    "1789d1",
	ID:          "ea167b",
	Links: map[string]interface{}{
		"self": "https://example.com/identity/v3/groups/ea167b",
	},
	Extra: map[string]interface{}{
		"building": "Hilltop A",
	},
	Name: "Developers",
}
View Source
var FirstProject = projects.Project{
	Description: "my first project",
	DomainID:    "11111",
	Enabled:     true,
	ID:          "abcde",
	Name:        "project 1",
	ParentID:    "11111",
}
View Source
var FirstUser = users.User{
	DomainID: "default",
	Enabled:  true,
	ID:       "2844b2a08be147a08ef58317d6471f1f",
	Links: map[string]interface{}{
		"self": "http://example.com/identity/v3/users/2844b2a08be147a08ef58317d6471f1f",
	},
	Name:              "glance",
	PasswordExpiresAt: nilTime,
	Description:       "some description",
	Extra: map[string]interface{}{
		"email": "glance@localhost",
	},
}
View Source
var SecondGroup = groups.Group{
	Description: "Developers cleared for work on secret projects",
	DomainID:    "1789d1",
	ID:          "a62db1",
	Links: map[string]interface{}{
		"self": "https://example.com/identity/v3/groups/a62db1",
	},
	Extra: map[string]interface{}{},
	Name:  "Secure Developers",
}
View Source
var SecondProject = projects.Project{
	Description: "my second project",
	DomainID:    "22222",
	Enabled:     true,
	ID:          "bcdef",
	Name:        "project 2",
	ParentID:    "22222",
}
View Source
var SecondUser = users.User{
	DefaultProjectID: "263fd9",
	DomainID:         "1789d1",
	Enabled:          true,
	ID:               "9fe1d3",
	Links: map[string]interface{}{
		"self": "https://example.com/identity/v3/users/9fe1d3",
	},
	Name:              "jsmith",
	PasswordExpiresAt: SecondUserPasswordExpiresAt,
	Extra: map[string]interface{}{
		"email": "jsmith@example.com",
	},
	Options: map[string]interface{}{
		"ignore_password_expiry": true,
		"multi_factor_auth_rules": []interface{}{
			[]string{"password", "totp"},
			[]string{"password", "custom-auth-method"},
		},
	},
}
View Source
var SecondUserNoOptions = users.User{
	DefaultProjectID: "263fd9",
	DomainID:         "1789d1",
	Enabled:          true,
	ID:               "9fe1d3",
	Links: map[string]interface{}{
		"self": "https://example.com/identity/v3/users/9fe1d3",
	},
	Name:              "jsmith",
	PasswordExpiresAt: SecondUserPasswordExpiresAt,
	Extra: map[string]interface{}{
		"email": "jsmith@example.com",
	},
}
View Source
var SecondUserPasswordExpiresAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2016-11-06T15:32:17.000000")

SecondUser is the second user in the List request.

View Source
var SecondUserUpdated = users.User{
	DefaultProjectID: "263fd9",
	DomainID:         "1789d1",
	Enabled:          false,
	ID:               "9fe1d3",
	Links: map[string]interface{}{
		"self": "https://example.com/identity/v3/users/9fe1d3",
	},
	Name:              "jsmith",
	PasswordExpiresAt: SecondUserPasswordExpiresAt,
	Extra: map[string]interface{}{
		"email":           "jsmith@example.com",
		"disabled_reason": "DDOS",
	},
	Options: map[string]interface{}{
		"ignore_password_expiry": true,
	},
}

SecondUserUpdated is how SecondUser should look after an Update.

Functions

func HandleAddToGroupSuccessfully

func HandleAddToGroupSuccessfully(t *testing.T)

HandleAddToGroupSuccessfully creates an HTTP handler at /groups/{groupID}/users/{userID} on the test handler mux that tests adding user to group.

func HandleChangeUserPasswordSuccessfully

func HandleChangeUserPasswordSuccessfully(t *testing.T)

HandleChangeUserPasswordSuccessfully creates an HTTP handler at `/users` on the test handler mux that tests change user password.

func HandleCreateNoOptionsUserSuccessfully

func HandleCreateNoOptionsUserSuccessfully(t *testing.T)

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

func HandleCreateUserSuccessfully

func HandleCreateUserSuccessfully(t *testing.T)

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

func HandleDeleteUserSuccessfully

func HandleDeleteUserSuccessfully(t *testing.T)

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

func HandleGetUserSuccessfully

func HandleGetUserSuccessfully(t *testing.T)

HandleGetUserSuccessfully creates an HTTP handler at `/users` on the test handler mux that responds with a single user.

func HandleIsMemberOfGroupSuccessfully

func HandleIsMemberOfGroupSuccessfully(t *testing.T)

HandleIsMemberOfGroupSuccessfully creates an HTTP handler at /groups/{groupID}/users/{userID} on the test handler mux that tests checking whether user belongs to group.

func HandleListInGroupSuccessfully

func HandleListInGroupSuccessfully(t *testing.T)

HandleListInGroupSuccessfully creates an HTTP handler at /groups/{groupID}/users on the test handler mux that response with a list of two users

func HandleListUserGroupsSuccessfully

func HandleListUserGroupsSuccessfully(t *testing.T)

HandleListUserGroupsSuccessfully creates an HTTP handler at /users/{userID}/groups on the test handler mux that respons with a list of two groups

func HandleListUserProjectsSuccessfully

func HandleListUserProjectsSuccessfully(t *testing.T)

HandleListUserProjectsSuccessfully creates an HTTP handler at /users/{userID}/projects on the test handler mux that respons wit a list of two projects

func HandleListUsersSuccessfully

func HandleListUsersSuccessfully(t *testing.T)

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

func HandleRemoveFromGroupSuccessfully

func HandleRemoveFromGroupSuccessfully(t *testing.T)

HandleRemoveFromGroupSuccessfully creates an HTTP handler at /groups/{groupID}/users/{userID} on the test handler mux that tests removing user from group.

func HandleUpdateUserSuccessfully

func HandleUpdateUserSuccessfully(t *testing.T)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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