test

package
v0.69.0 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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TEST_CONFIG_FILE_NAME string = `__test_fsoc__`
View Source
var TEST_CONTEXT_NAME string = `__test__`

Functions

func CaptureConsoleOutput

func CaptureConsoleOutput(f func(), t *testing.T) string

CaptureConsoleOutput - captures the console output as a string and return useful in test cases

func ReadFileToString

func ReadFileToString(path string) (string, error)

ReadFileToString - Read a file and return contents as string

func SetActiveConfigProfileServer added in v0.69.0

func SetActiveConfigProfileServer(serverUrl string) (teardown func())

SetActiveConfigProfileServer creates a test profile configured with the given URL. Note the original config will need to be restored which is most easily accomplished with the returned teardown method by defering it in the caller like such

server := httptest.NewServer(...)
defer config.SetActiveConfigProfileServer(server.URL)()

Types

This section is empty.

Jump to

Keyboard shortcuts

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