testing

package
v1.11.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const GetHistoriesResult = `` /* 358-byte string literal not displayed */

GetHistoriesResult provides a single page of Usage results.

View Source
const ListResult = `` /* 766-byte string literal not displayed */

ListResult provides a single page of Usage results.

Variables

View Source
var ExpectedHistories = &usages.UsageHistories{
	Unit:        "License",
	ResourceID:  "1bc271e7a8af4d988ff91612f5b122f8",
	LicenseType: "vCenter Server 6.x Standard",
	Histories:   []usages.History{FirstHistory, SecondHistory},
}

ExpectedHistories is the UsageHistories expected to be returned from GetHistoriesResult.

View Source
var ExpectedUsagesSlice = []usages.Usage{FirstUsage, SecondUsage}

ExpectedUsagesSlice is the slice of LicenseTypes expected to be returned from ListResult.

View Source
var FirstHistory = usages.History{
	Time:  time.Date(2019, 10, 10, 0, 0, 0, 0, time.UTC),
	Value: "1",
}

FirstHistory is the first History in the Get histories request.

View Source
var FirstUsage = usages.Usage{
	ID:            "9ada4c06-a2a4-46d5-b969-72ac12433a79",
	Type:          "dedicated-hypervisor.guest-image.vcenter-server-6-0-standard",
	Value:         "2",
	Unit:          "License",
	Name:          "vCenter Server 6.x Standard",
	Description:   "vCenter Server 6.x Standard",
	HasLicenseKey: true,
	ResourceID:    "1bc271e7a8af4d988ff91612f5b122f8",
}

FirstUsage is the first Usage in the List request.

View Source
var SecondHistory = usages.History{
	Time:  time.Date(2019, 10, 10, 1, 0, 0, 0, time.UTC),
	Value: "1",
}

SecondHistory is the second History in the Get histories request.

View Source
var SecondUsage = usages.Usage{
	ID:            "9da9116d-cc44-4ad8-aca5-7db398fcb478",
	Type:          "dedicated-hypervisor.guest-image.sql-server-2014-standard",
	Value:         "6",
	Unit:          "vCPU",
	Name:          "SQL Server 2014 Standard Edition",
	Description:   "SQL Server 2014 Standard Edition",
	HasLicenseKey: false,
	ResourceID:    "d-cc44-4ad8-aca5-7db398fcb477bbbbbb",
}

SecondUsage is the second Usage in the List request.

Functions

func HandleGetHistoriesSuccessfully

func HandleGetHistoriesSuccessfully(t *testing.T)

HandleGetHistoriesSuccessfully creates an HTTP handler at `/usages/<usageID>/histories` on the test handler mux that responds with usage histories.

func HandleListUsagesSuccessfully

func HandleListUsagesSuccessfully(t *testing.T)

HandleListUsagesSuccessfully creates an HTTP handler at `/usages` on the test handler mux that responds with a list of two Usages.

Types

This section is empty.

Jump to

Keyboard shortcuts

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