testing

package
v0.0.0-...-ae37572 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

simple tenant usage unit tests

Index

Constants

View Source
const FirstTenantID = "aabbccddeeff112233445566"
View Source
const GetSingleTenant = `` /* 2044-byte string literal not displayed */

GetSingleTenant holds the fixtures for the content of the request for a single tenant.

Variables

View Source
var SingleTenantUsageResults = usage.TenantUsage{
	ServerUsages: []usage.ServerUsage{
		{
			Flavor:     "m1.tiny",
			Hours:      0.021675453333333334,
			InstanceID: "a70096fd-8196-406b-86c4-045840f53ad7",
			LocalGB:    1,
			MemoryMB:   512,
			Name:       "jttest",
			StartedAt:  time.Date(2017, 11, 30, 3, 23, 43, 0, time.UTC),
			State:      "active",
			TenantID:   "aabbccddeeff112233445566",
			Uptime:     78,
			VCPUs:      1,
		},
		{
			Flavor:     "m1.acctest",
			Hours:      0.33444444444444443,
			InstanceID: "c04e38f2-dcee-4ca8-9466-7708d0a9b6dd",
			LocalGB:    15,
			MemoryMB:   512,
			Name:       "basic",
			StartedAt:  time.Date(2017, 11, 21, 3, 50, 7, 0, time.UTC),
			EndedAt:    time.Date(2017, 11, 21, 4, 10, 11, 0, time.UTC),
			State:      "terminated",
			TenantID:   "aabbccddeeff112233445566",
			Uptime:     1204,
			VCPUs:      1,
		},
		{
			Flavor:     "m1.acctest",
			Hours:      0.004166666666666667,
			InstanceID: "ceb654fa-e0e8-44fb-8942-e4d0bfad3941",
			LocalGB:    15,
			MemoryMB:   512,
			Name:       "ACPTTESTJSxbPQAC34lTnBE1",
			StartedAt:  time.Date(2017, 11, 30, 3, 21, 6, 0, time.UTC),
			EndedAt:    time.Date(2017, 11, 30, 3, 21, 21, 0, time.UTC),
			State:      "terminated",
			TenantID:   "aabbccddeeff112233445566",
			Uptime:     15,
			VCPUs:      1,
		},
	},
	Start:              time.Date(2017, 11, 2, 3, 25, 1, 0, time.UTC),
	Stop:               time.Date(2017, 11, 30, 3, 25, 1, 0, time.UTC),
	TenantID:           "aabbccddeeff112233445566",
	TotalHours:         1.25834212,
	TotalLocalGBUsage:  18.571675453333334,
	TotalMemoryMBUsage: 644.27116544,
	TotalVCPUsUsage:    1.25834212,
}

SingleTenantUsageResults is the code fixture for GetSingleTenant.

Functions

func HandleGetSingleTenantSuccessfully

func HandleGetSingleTenantSuccessfully(t *testing.T)

HandleGetSingleTenantSuccessfully configures the test server to respond to a Get request for a single tenant

Types

This section is empty.

Jump to

Keyboard shortcuts

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