testing

package
v0.0.0-...-f8ec1b3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

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 ListOutput = `` /* 1214-byte string literal not displayed */

ListOutput provides a single page of User results.

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 as Update request.

Variables

View Source
var ExpectedUsersSlice = []users.User{FirstUser, SecondUser}

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

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 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 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 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 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