testing

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

quotasets unit tests

Index

Constants

View Source
const FirstTenantID = "555544443333222211110000ffffeeee"
View Source
const GetDetailsOutput = `` /* 1357-byte string literal not displayed */

GetDetailsOutput is a sample response to a Get call with the detailed option.

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

GetOutput is a sample response to a Get call.

View Source
const PartialUpdateBody = `{"quota_set":{"cores":200, "force":true}}`

The expected partialupdate Body. Is also returned by PUT request

View Source
const UpdateOutput = `` /* 298-byte string literal not displayed */

The expected update Body. Is also returned by PUT request

Variables

View Source
var FirstQuotaDetailsSet = quotasets.QuotaDetailSet{
	ID:                       FirstTenantID,
	InjectedFileContentBytes: quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 10240},
	InjectedFilePathBytes:    quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 255},
	InjectedFiles:            quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 5},
	KeyPairs:                 quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 10},
	MetadataItems:            quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 128},
	RAM:                      quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 200000},
	SecurityGroupRules:       quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 20},
	SecurityGroups:           quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 10},
	Cores:                    quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 200},
	Instances:                quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 25},
	ServerGroups:             quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 2},
	ServerGroupMembers:       quotasets.QuotaDetail{InUse: 0, Reserved: 0, Limit: 3},
}

FirstQuotaDetailsSet is the first result in ListOutput.

View Source
var FirstQuotaSet = quotasets.QuotaSet{
	FixedIPs:                 0,
	FloatingIPs:              0,
	InjectedFileContentBytes: 10240,
	InjectedFilePathBytes:    255,
	InjectedFiles:            5,
	KeyPairs:                 10,
	MetadataItems:            128,
	RAM:                      200000,
	SecurityGroupRules:       20,
	SecurityGroups:           10,
	Cores:                    200,
	Instances:                25,
	ServerGroups:             2,
	ServerGroupMembers:       3,
}

FirstQuotaSet is the first result in ListOutput.

View Source
var UpdatedQuotaSet = quotasets.UpdateOpts{
	FixedIPs:                 golangsdk.IntToPointer(0),
	FloatingIPs:              golangsdk.IntToPointer(0),
	InjectedFileContentBytes: golangsdk.IntToPointer(10240),
	InjectedFilePathBytes:    golangsdk.IntToPointer(255),
	InjectedFiles:            golangsdk.IntToPointer(5),
	KeyPairs:                 golangsdk.IntToPointer(10),
	MetadataItems:            golangsdk.IntToPointer(128),
	RAM:                      golangsdk.IntToPointer(200000),
	SecurityGroupRules:       golangsdk.IntToPointer(20),
	SecurityGroups:           golangsdk.IntToPointer(10),
	Cores:                    golangsdk.IntToPointer(200),
	Instances:                golangsdk.IntToPointer(25),
	ServerGroups:             golangsdk.IntToPointer(2),
	ServerGroupMembers:       golangsdk.IntToPointer(3),
}

Result of Quota-update

Functions

func HandleDeleteSuccessfully

func HandleDeleteSuccessfully(t *testing.T)

HandleDeleteSuccessfully configures the test server to respond to a Delete request for sample tenant

func HandleGetDetailSuccessfully

func HandleGetDetailSuccessfully(t *testing.T)

HandleGetDetailSuccessfully configures the test server to respond to a Get Details request for sample tenant

func HandleGetSuccessfully

func HandleGetSuccessfully(t *testing.T)

HandleGetSuccessfully configures the test server to respond to a Get request for sample tenant

func HandlePartialPutSuccessfully

func HandlePartialPutSuccessfully(t *testing.T)

HandlePartialPutSuccessfully configures the test server to respond to a Put request for sample tenant that only containes specific values

func HandlePutSuccessfully

func HandlePutSuccessfully(t *testing.T)

HandlePutSuccessfully configures the test server to respond to a Put request for sample tenant

Types

This section is empty.

Jump to

Keyboard shortcuts

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