test

package
v0.0.0-...-f82a63c Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockProviderClient

type MockProviderClient struct {
	Domains  map[string]core.CachedDomain
	Projects map[string]core.CachedProject
}

MockProviderClient implements the core.ProviderClientInterface.

func (MockProviderClient) CloudAdminClient

func (MockProviderClient) FindProjectID

func (c MockProviderClient) FindProjectID(projectName, projectDomainName string) (string, error)

func (MockProviderClient) GetAuthResult

func (c MockProviderClient) GetAuthResult() gophercloud.AuthResult

func (MockProviderClient) GetDomain

func (c MockProviderClient) GetDomain(domainID string) (*core.CachedDomain, error)

func (MockProviderClient) GetProject

func (c MockProviderClient) GetProject(projectID string) (*core.CachedProject, error)

func (MockProviderClient) ProjectScopedClient

type T

type T struct {
	*testing.T
}

T extends testing.T with custom helper methods.

func (T) AssertJSONEqual

func (t T) AssertJSONEqual(variable string, actual, expected any)

AssertJSONEqual checks that both given values have identical JSON serializations.

func (T) ExpectAssets

func (t T) ExpectAssets(dbi *gorp.DbMap, assets ...db.Asset)

ExpectAssets checks that the DB contains exactly the given assets.

func (T) ExpectFinishedOperations

func (t T) ExpectFinishedOperations(dbi *gorp.DbMap, ops ...db.FinishedOperation)

ExpectFinishedOperations checks that the DB contains exactly the given finished ops.

func (T) ExpectPendingOperations

func (t T) ExpectPendingOperations(dbi *gorp.DbMap, ops ...db.PendingOperation)

ExpectPendingOperations checks that the DB contains exactly the given pending ops.

func (T) Must

func (t T) Must(err error)

Must fails the test if the given error is non-nil.

func (T) MustExec

func (t T) MustExec(dbi *gorp.DbMap, query string, args ...any)

MustExec fails the test if dbi.Exec(query) returns an error.

func (T) MustUpdate

func (t T) MustUpdate(dbi *gorp.DbMap, row any)

MustUpdate aborts the test if dbi.Update(row) throws an error.

func (T) WithDB

func (t T) WithDB(fixtureFile *string, action func(dbi *gorp.DbMap))

WithDB prepares a DB reference for this test, or fails the test if the DB is not ready.

Jump to

Keyboard shortcuts

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