Documentation ¶
Overview ¶
Package testing contains policies unit tests
Index ¶
Constants ¶
const CreateRequest = `` /* 161-byte string literal not displayed */
CreateRequest provides the input to a Create request.
const GetOutput = `` /* 336-byte string literal not displayed */
GetOutput provides a Get result.
const ListOutput = `` /* 814-byte string literal not displayed */
ListOutput provides a single page of Policy results.
const ListWithFilterOutput = `` /* 514-byte string literal not displayed */
ListWithFilterOutput provides a single page of filtered Policy results.
const UpdateOutput = `` /* 344-byte string literal not displayed */
UpdateOutput provides an update result.
const UpdateRequest = `
{
"policy": {
"description": "updated policy for bar_user"
}
}
`
UpdateRequest provides the input to as Update request.
Variables ¶
var ExpectedPoliciesSlice = []policies.Policy{FirstPolicy, SecondPolicy}
ExpectedPoliciesSlice is the slice of policies expected to be returned from ListOutput.
var FirstPolicy = policies.Policy{ ID: "2844b2a08be147a08ef58317d6471f1f", Blob: "'foo_user': 'role:compute-user'", Type: "text/plain", Links: map[string]interface{}{ "self": "http://example.com/identity/v3/policies/2844b2a08be147a08ef58317d6471f1f", }, Extra: map[string]interface{}{}, }
FirstPolicy is the first policy in the List request.
var SecondPolicy = policies.Policy{ ID: "b49884da9d31494ea02aff38d4b4e701", Blob: "{'bar_user': 'role:network-user'}", Type: "application/json", Links: map[string]interface{}{ "self": "http://example.com/identity/v3/policies/b49884da9d31494ea02aff38d4b4e701", }, Extra: map[string]interface{}{ "description": "policy for bar_user", }, }
SecondPolicy is the second policy in the List request.
var SecondPolicyUpdated = policies.Policy{ ID: "b49884da9d31494ea02aff38d4b4e701", Blob: "{'bar_user': 'role:network-user'}", Type: "application/json", Links: map[string]interface{}{ "self": "http://example.com/identity/v3/policies/b49884da9d31494ea02aff38d4b4e701", }, Extra: map[string]interface{}{ "description": "updated policy for bar_user", }, }
SecondPolicyUpdated is the policy in the Update request.
Functions ¶
func HandleCreatePolicySuccessfully ¶
HandleCreatePolicySuccessfully creates an HTTP handler at `/policies` on the test handler mux that tests policy creation.
func HandleDeletePolicySuccessfully ¶
HandleDeletePolicySuccessfully creates an HTTP handler at `/policies` on the test handler mux that tests policy deletion.
func HandleGetPolicySuccessfully ¶
HandleGetPolicySuccessfully creates an HTTP handler at `/policies` on the test handler mux that responds with a single policy.
func HandleListPoliciesSuccessfully ¶
HandleListPoliciesSuccessfully creates an HTTP handler at `/policies` on the test handler mux that responds with a list of two policies.
func HandleUpdatePolicySuccessfully ¶
HandleUpdatePolicySuccessfully creates an HTTP handler at `/policies` on the test handler mux that tests role update.
Types ¶
This section is empty.