Documentation ¶
Overview ¶
services unit tests
Index ¶
Constants ¶
const CreateRequest = `` /* 163-byte string literal not displayed */
CreateRequest provides the input to a Create request.
const GetOutput = `` /* 350-byte string literal not displayed */
GetOutput provides a Get result.
const ListOutput = `` /* 824-byte string literal not displayed */
ListOutput provides a single page of Service results.
const UpdateOutput = `` /* 359-byte string literal not displayed */
UpdateOutput provides an update result.
const UpdateRequest = `
{
"service": {
"type": "compute2",
"description": "Service Two Updated"
}
}
`
UpdateRequest provides the input to as Update request.
Variables ¶
var ExpectedServicesSlice = []services.Service{FirstService, SecondService}
ExpectedServicesSlice is the slice of services to be returned from ListOutput.
var FirstService = services.Service{ ID: "1234", Links: map[string]interface{}{ "self": "https://example.com/identity/v3/services/1234", }, Type: "identity", Enabled: false, Extra: map[string]interface{}{ "name": "service-one", "description": "Service One", }, }
FirstService is the first service in the List request.
var SecondService = services.Service{ ID: "9876", Links: map[string]interface{}{ "self": "https://example.com/identity/v3/services/9876", }, Type: "compute", Enabled: false, Extra: map[string]interface{}{ "name": "service-two", "description": "Service Two", "email": "service@example.com", }, }
SecondService is the second service in the List request.
var SecondServiceUpdated = services.Service{ ID: "9876", Links: map[string]interface{}{ "self": "https://example.com/identity/v3/services/9876", }, Type: "compute2", Enabled: false, Extra: map[string]interface{}{ "name": "service-two", "description": "Service Two Updated", "email": "service@example.com", }, }
SecondServiceUpdated is the SecondService should look after an Update.
Functions ¶
func HandleCreateServiceSuccessfully ¶
HandleCreateServiceSuccessfully creates an HTTP handler at `/services` on the test handler mux that tests service creation.
func HandleGetServiceSuccessfully ¶
HandleGetServiceSuccessfully creates an HTTP handler at `/services` on the test handler mux that responds with a single service.
func HandleListServicesSuccessfully ¶
HandleListServicesSuccessfully creates an HTTP handler at `/services` on the test handler mux that responds with a list of two services.
func HandleUpdateServiceSuccessfully ¶
HandleUpdateServiceSuccessfully creates an HTTP handler at `/services` on the test handler mux that tests service update.
Types ¶
This section is empty.