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

testing

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

transfer requests unit tests

Index

Constants

View Source
const CreateTransferRequest = `` /* 138-byte string literal not displayed */

CreateTransferRequest is a sample request to create a zone.

View Source
const CreateTransferRequestResponse = `` /* 563-byte string literal not displayed */

CreateZoneResponse is a sample response to a create request.

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

GetOutput is a sample response to a Get call.

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

ListOutput is a sample response to a List call.

View Source
const UpdateTransferRequest = `
{
    "description": "Updated Description"
}
`

UpdateTransferRequest is a sample request to update a zone transfer request.

View Source
const UpdatedTransferRequestResponse = `` /* 536-byte string literal not displayed */

UpdatedTransferRequestResponse is a sample response to update a zone transfer request.

Variables

View Source
var CreatedTransferRequest = FirstTransferRequest

CreatedTransferRequest is the expected created zone transfer request.

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

View Source
var FirstTransferRequest = transferRequests.TransferRequest{
	ID:              "a86dba58-0043-4cc6-a1bb-69d5e86f3ca3",
	ZoneID:          "a6a8515c-5d80-48c0-955b-fde631b59791",
	ProjectID:       "4335d1f0-f793-11e2-b778-0800200c9a66",
	TargetProjectID: "05d98711-b3a1-4264-a395-f46383671ee6",
	ZoneName:        "example1.org.",
	Key:             "KJSDH23Z",
	Description:     "This is a first example zone transfer request.",
	Status:          "ACTIVE",
	CreatedAt:       FirstTransferRequestCreatedAt,
	Links: map[string]interface{}{
		"self": "https://127.0.0.1:9001/v2/zones/tasks/transfer_requests/a86dba58-0043-4cc6-a1bb-69d5e86f3ca3",
	},
}
View Source
var FirstTransferRequestCreatedAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2020-10-12T08:38:58.000000")

FirstTransferRequest is the first result in ListOutput

View Source
var SecondTransferRequest = transferRequests.TransferRequest{
	ID:              "34c4561c-9205-4386-9df5-167436f5a222",
	ZoneID:          "572ba08c-d929-4c70-8e42-03824bb24ca2",
	ProjectID:       "4335d1f0-f793-11e2-b778-0800200c9a66",
	TargetProjectID: "05d98711-b3a1-4264-a395-f46383671ee6",
	ZoneName:        "example2.org.",
	Key:             "KSDFJ22H",
	Description:     "This is second example zone transfer request.",
	Status:          "ACTIVE",
	CreatedAt:       SecondTransferRequestCreatedAt,
	UpdatedAt:       SecondTransferRequestUpdatedAt,
	Links: map[string]interface{}{
		"self": "https://127.0.0.1:9001/v2/zones/tasks/transfer_requests/34c4561c-9205-4386-9df5-167436f5a222",
	},
}
View Source
var SecondTransferRequestCreatedAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2020-10-12T09:38:58.000000")

SecondTransferRequest is the second result in ListOutput

View Source
var SecondTransferRequestUpdatedAt, _ = time.Parse(gophercloud.RFC3339MilliNoZ, "2020-10-12T10:38:58.000000")

Functions

func HandleCreateSuccessfully

func HandleCreateSuccessfully(t *testing.T)

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

func HandleDeleteSuccessfully

func HandleDeleteSuccessfully(t *testing.T)

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

HandleTransferRequestUpdateSuccessfully 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