testing

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

ports unit tests

Index

Constants

View Source
const PortListBody = `` /* 1027-byte string literal not displayed */

PortListBody contains the canned body of a ports.List response, without detail.

View Source
const PortListDetailBody = `` /* 1784-byte string literal not displayed */

PortListDetailBody contains the canned body of a port.ListDetail response.

View Source
const SinglePortBody = `` /* 731-byte string literal not displayed */

SinglePortBody is the canned body of a Get request on an existing port.

Variables

View Source
var (
	BarCreated, _ = time.Parse(time.RFC3339, "2019-02-15T09:52:23+00:00")
	BarUpdated, _ = time.Parse(time.RFC3339, "2019-02-15T09:55:19+00:00")
	PortFoo       = ports.Port{
		UUID:                "f2845e11-dbd4-4728-a8c0-30d19f48924a",
		NodeUUID:            "ddd06a60-b91e-4ab4-a6e7-56c0b25b6086",
		Address:             "52:54:00:4d:87:e6",
		PXEEnabled:          true,
		LocalLinkConnection: map[string]interface{}{},
		InternalInfo:        map[string]interface{}{},
		Extra:               map[string]interface{}{},
		CreatedAt:           fooCreated,
		UpdatedAt:           fooUpdated,
		Links:               []interface{}{map[string]interface{}{"href": "http://192.168.0.8/baremetal/v1/ports/f2845e11-dbd4-4728-a8c0-30d19f48924a", "rel": "self"}, map[string]interface{}{"href": "http://192.168.0.8/baremetal/ports/f2845e11-dbd4-4728-a8c0-30d19f48924a", "rel": "bookmark"}},
	}

	PortBar = ports.Port{
		UUID:                "3abe3f36-9708-4e9f-b07e-0f898061d3a7",
		NodeUUID:            "ddd06a60-b91e-4ab4-a6e7-56c0b25b6086",
		Address:             "52:54:00:0a:af:d1",
		PXEEnabled:          true,
		LocalLinkConnection: map[string]interface{}{},
		InternalInfo:        map[string]interface{}{},
		Extra:               map[string]interface{}{},
		CreatedAt:           BarCreated,
		UpdatedAt:           BarUpdated,
		Links:               []interface{}{map[string]interface{}{"href": "http://192.168.0.8/baremetal/v1/ports/3abe3f36-9708-4e9f-b07e-0f898061d3a7", "rel": "self"}, map[string]interface{}{"rel": "bookmark", "href": "http://192.168.0.8/baremetal/ports/3abe3f36-9708-4e9f-b07e-0f898061d3a7"}},
	}
)

Functions

func HandlePortCreationSuccessfully

func HandlePortCreationSuccessfully(t *testing.T, response string)

HandleSPortCreationSuccessfully sets up the test server to respond to a port creation request with a given response.

func HandlePortDeletionSuccessfully

func HandlePortDeletionSuccessfully(t *testing.T)

HandlePortDeletionSuccessfully sets up the test server to respond to a port deletion request.

func HandlePortGetSuccessfully

func HandlePortGetSuccessfully(t *testing.T)

func HandlePortListDetailSuccessfully

func HandlePortListDetailSuccessfully(t *testing.T)

HandlePortListSuccessfully sets up the test server to respond to a port List request.

func HandlePortListSuccessfully

func HandlePortListSuccessfully(t *testing.T)

HandlePortListSuccessfully sets up the test server to respond to a port List request.

func HandlePortUpdateSuccessfully

func HandlePortUpdateSuccessfully(t *testing.T, response string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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