Help us shape the future of Go! Take the 2026 Go Developer Survey

testing

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

zones unit tests

Index

Constants

View Source
const CreateZoneRequest = `` /* 151-byte string literal not displayed */

CreateZoneRequest is a sample request to create a zone.

View Source
const CreateZoneResponse = `` /* 632-byte string literal not displayed */

CreateZoneResponse is a sample response to a create request.

View Source
const DeleteZoneResponse = `` /* 627-byte string literal not displayed */

DeleteZoneResponse is a sample response to update a zone.

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

GetOutput is a sample response to a Get call.

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

List Output is a sample response to a List call.

View Source
const UpdateZoneRequest = `
{
    "ttl": 600,
    "description": "Updated Description"
}
`

UpdateZoneRequest is a sample request to update a zone.

View Source
const UpdateZoneResponse = `` /* 627-byte string literal not displayed */

UpdateZoneResponse is a sample response to update a zone.

Variables

View Source
var CreatedZone = FirstZone

CreatedZone is the expected created zone

View Source
var ExpectedZonesSlice = []zones.Zone{FirstZone, SecondZone}

ExpectedZonesSlice is the slice of results that should be parsed from ListOutput, in the expected order.

View Source
var FirstZone = zones.Zone{
	ID:          "a86dba58-0043-4cc6-a1bb-69d5e86f3ca3",
	PoolID:      "572ba08c-d929-4c70-8e42-03824bb24ca2",
	ProjectID:   "4335d1f0-f793-11e2-b778-0800200c9a66",
	Name:        "example.org.",
	Email:       "joe@example.org",
	TTL:         7200,
	Serial:      1404757531,
	Status:      "ACTIVE",
	Action:      "CREATE",
	Description: "This is an example zone.",
	Masters:     []string{},
	Type:        "PRIMARY",
	Version:     1,
	CreatedAt:   FirstZoneCreatedAt,
	Links: map[string]interface{}{
		"self": "https://127.0.0.1:9001/v2/zones/a86dba58-0043-4cc6-a1bb-69d5e86f3ca3",
	},
}
View Source
var FirstZoneCreatedAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2014-07-07T18:25:31.275934")

FirstZone is the first result in ListOutput

View Source
var SecondZone = zones.Zone{
	ID:          "34c4561c-9205-4386-9df5-167436f5a222",
	PoolID:      "572ba08c-d929-4c70-8e42-03824bb24ca2",
	ProjectID:   "4335d1f0-f793-11e2-b778-0800200c9a66",
	Name:        "foo.example.com.",
	Email:       "joe@foo.example.com",
	TTL:         7200,
	Serial:      1488053571,
	Status:      "ACTIVE",
	Action:      "CREATE",
	Description: "This is another example zone.",
	Masters:     []string{"example.com."},
	Type:        "PRIMARY",
	Version:     1,
	CreatedAt:   SecondZoneCreatedAt,
	UpdatedAt:   SecondZoneUpdatedAt,
	Links: map[string]interface{}{
		"self": "https://127.0.0.1:9001/v2/zones/34c4561c-9205-4386-9df5-167436f5a222",
	},
}
View Source
var SecondZoneCreatedAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2014-07-07T18:25:31.275934")
View Source
var SecondZoneUpdatedAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2015-02-25T20:23:01.234567")

Functions

func HandleCreateSuccessfully

func HandleCreateSuccessfully(t *testing.T)

HandleZoneCreationSuccessfully configures the test server to respond to a Create request.

func HandleDeleteSuccessfully

func HandleDeleteSuccessfully(t *testing.T)

HandleZoneDeleteSuccessfully configures the test server to respond to an Delete request.

func HandleGetSuccessfully

func HandleGetSuccessfully(t *testing.T)

HandleGetSuccessfully configures the test server to respond to a List request.

func HandleListSuccessfully

func HandleListSuccessfully(t *testing.T)

HandleListSuccessfully configures the test server to respond to a List request.

func HandleUpdateSuccessfully

func HandleUpdateSuccessfully(t *testing.T)

HandleZoneUpdateSuccessfully configures the test server to respond to an Update request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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