scloud

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

README

In order to run the functional tests, you must first build and setup scloud.

Make sure you have a valid access token:

	$ scloud login

Make sure the tenant setting names the tenant that will be used for the tests.

	$ scloud set tenant <test-tenant>

Run the tests!

	$ python -m unittest discover .

Documentation

Index

Constants

View Source
const UnitTestHost = "testing.splunk.com"
View Source
const UnitTestScheme = "https"
View Source
const UnitTestTenant = "faketenant"
View Source
const UnitTestToken = "faketoken"

Variables

This section is empty.

Functions

func BodyToString

func BodyToString(t *testing.T, requestBody io.ReadCloser) string

Tries to read a http.Request.Body and return its contents as a string

func ErrorToRequest

func ErrorToRequest(t *testing.T, err error) http.Request

The Go http.client do() function wraps any error from a roundtripper inside a url.Error under the Err field

func GetUnitTestClient

func GetUnitTestClient() *sdk.Client

Types

type UnitTestError

type UnitTestError struct {
	Req http.Request
}

UnitTestError wraps an http request

func (*UnitTestError) Error

func (self *UnitTestError) Error() string

This function is just here to implement the error interface

type UnitTestTransport

type UnitTestTransport struct {
	// contains filtered or unexported fields
}

UnitTestTransport is only used for GetUnitTestClient() to abort requests immediately

func (*UnitTestTransport) RoundTrip

func (self *UnitTestTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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