testing

package
v0.0.0-...-1fd1e9e Latest Latest
Warning

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

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

Documentation

Overview

networks unit tests

Index

Constants

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

GetOutput is a sample response to a Get call.

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

ListOutput is a sample response to a List call.

Variables

View Source
var ExpectedNetworkSlice = []networks.Network{FirstNetwork, SecondNetwork}

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

View Source
var FirstNetwork = networks.Network{
	Bridge:            "br100",
	BridgeInterface:   "eth0",
	Broadcast:         "10.0.0.7",
	CIDR:              "10.0.0.0/29",
	CIDRv6:            "",
	CreatedAt:         gophercloud.JSONRFC3339MilliNoZ(time.Date(2011, 8, 15, 6, 19, 19, 387525000, time.UTC)),
	Deleted:           false,
	DeletedAt:         gophercloud.JSONRFC3339MilliNoZ(nilTime),
	DHCPStart:         "10.0.0.3",
	DNS1:              "",
	DNS2:              "",
	Gateway:           "10.0.0.1",
	Gatewayv6:         "",
	Host:              "nsokolov-desktop",
	ID:                "20c8acc0-f747-4d71-a389-46d078ebf047",
	Injected:          false,
	Label:             "mynet_0",
	MultiHost:         false,
	Netmask:           "255.255.255.248",
	Netmaskv6:         "",
	Priority:          0,
	ProjectID:         "1234",
	RXTXBase:          0,
	UpdatedAt:         gophercloud.JSONRFC3339MilliNoZ(time.Date(2011, 8, 16, 9, 26, 13, 48257000, time.UTC)),
	VLAN:              100,
	VPNPrivateAddress: "10.0.0.2",
	VPNPublicAddress:  "127.0.0.1",
	VPNPublicPort:     1000,
}
View Source
var SecondNetwork = networks.Network{
	Bridge:            "br101",
	BridgeInterface:   "eth0",
	Broadcast:         "10.0.0.15",
	CIDR:              "10.0.0.10/29",
	CIDRv6:            "",
	CreatedAt:         gophercloud.JSONRFC3339MilliNoZ(time.Date(2011, 8, 15, 6, 19, 19, 387525000, time.UTC)),
	Deleted:           false,
	DeletedAt:         gophercloud.JSONRFC3339MilliNoZ(nilTime),
	DHCPStart:         "10.0.0.11",
	DNS1:              "",
	DNS2:              "",
	Gateway:           "10.0.0.9",
	Gatewayv6:         "",
	Host:              "",
	ID:                "20c8acc0-f747-4d71-a389-46d078ebf000",
	Injected:          false,
	Label:             "mynet_1",
	MultiHost:         false,
	Netmask:           "255.255.255.248",
	Netmaskv6:         "",
	Priority:          0,
	ProjectID:         "",
	RXTXBase:          0,
	UpdatedAt:         gophercloud.JSONRFC3339MilliNoZ(nilTime),
	VLAN:              101,
	VPNPrivateAddress: "10.0.0.10",
	VPNPublicAddress:  "",
	VPNPublicPort:     1001,
}

SecondNetwork is the second result in ListOutput.

Functions

func HandleGetSuccessfully

func HandleGetSuccessfully(t *testing.T)

HandleGetSuccessfully configures the test server to respond to a Get request for an existing network.

func HandleListSuccessfully

func HandleListSuccessfully(t *testing.T)

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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