Documentation ¶
Overview ¶
ports unit tests
Index ¶
- Constants
- Variables
- func HandlePortCreationSuccessfully(t *testing.T, response string)
- func HandlePortDeletionSuccessfully(t *testing.T)
- func HandlePortGetSuccessfully(t *testing.T)
- func HandlePortListDetailSuccessfully(t *testing.T)
- func HandlePortListSuccessfully(t *testing.T)
- func HandlePortUpdateSuccessfully(t *testing.T, response string)
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 ¶
HandleSPortCreationSuccessfully sets up the test server to respond to a port creation request with a given response.
func HandlePortDeletionSuccessfully ¶
HandlePortDeletionSuccessfully sets up the test server to respond to a port deletion request.
func HandlePortListDetailSuccessfully ¶
HandlePortListSuccessfully sets up the test server to respond to a port List request.
func HandlePortListSuccessfully ¶
HandlePortListSuccessfully sets up the test server to respond to a port List request.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.