testutils

package
v0.0.0-...-f7e20ac Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorMessageAuthentication = "Requires authentication"
	ErrorMessageRepo           = "invalid repo parameter"
	ErrorMessageOwner          = "invalid owner parameter"
	ErrorMessageScope          = "invalid scope parameter"
	ErrorMessagePull           = "invalid pull parameter"
	ErrorMessageInvalidSHA     = "invalid SHA parameter"
)

represents the error messages returned when validating parameters provided to service functions

Variables

This section is empty.

Functions

func GetMockDataApprovedPRForCommitResponsesMessage

func GetMockDataApprovedPRForCommitResponsesMessage() io.ReadCloser

GetMockDataApprovedPRForCommitResponsesMessage returns a matching approved PR for the commit sha AABCDEF123456

func GetMockDataClosedPRForCommitResponsesMessage

func GetMockDataClosedPRForCommitResponsesMessage() io.ReadCloser

GetMockDataClosedPRForCommitResponsesMessage returns a matching closed but not merged PR for the commit sha AABCDEF123456

func GetMockDataCommitsResponseMessage

func GetMockDataCommitsResponseMessage() io.ReadCloser

GetMockDataCommitsResponseMessage represents mock data to be used for multiple Commits returned from a function call

func GetMockDataCommitsResponseStatusCode

func GetMockDataCommitsResponseStatusCode() int

GetMockDataCommitsResponseStatusCode represents mock data to be used for a successful status code

func GetMockDataNoPRForCommitResponsesMessage

func GetMockDataNoPRForCommitResponsesMessage() io.ReadCloser

GetMockDataNoPRForCommitResponsesMessage returns no matching PRs

func GetMockDataPRsResponseMessage

func GetMockDataPRsResponseMessage() io.ReadCloser

GetMockDataPRsResponseMessage represents mock data to be used for multiple PRs

func GetMockDataPRsResponseStatusCode

func GetMockDataPRsResponseStatusCode() int

GetMockDataPRsResponseStatusCode represents mock data to be used for a successful status code

func GetMockDataSingleCommitResponseMessage

func GetMockDataSingleCommitResponseMessage() io.ReadCloser

GetMockDataSingleCommitResponseMessage represents mock data to be used for a SingleCommitResponse

func GetMockDataSingleCommitResponseStatusCode

func GetMockDataSingleCommitResponseStatusCode() int

GetMockDataSingleCommitResponseStatusCode represents mock data to be used for a status code of a message returning a SingleCommitResponse struct

func GetMockDataSinglePRResponseMessage

func GetMockDataSinglePRResponseMessage() io.ReadCloser

GetMockDataSinglePRResponseMessage represents mock data to be used fo a single PR returned from a function

func GetMockDataSinglePRResponseStatusCode

func GetMockDataSinglePRResponseStatusCode() int

GetMockDataSinglePRResponseStatusCode represents mock data to be used for a successful status code

func GetMockDataSingleSliceCommitResponsesMessage

func GetMockDataSingleSliceCommitResponsesMessage() io.ReadCloser

GetMockDataSingleSliceCommitResponsesMessage returns a single commit that is a merge commit

func GetMockDataSingleSliceNonMergeCommitResponsesMessage

func GetMockDataSingleSliceNonMergeCommitResponsesMessage() io.ReadCloser

GetMockDataSingleSliceNonMergeCommitResponsesMessage returns a commit that is not a merge commit

func GetMockDataUnauthorisedResponseMessage

func GetMockDataUnauthorisedResponseMessage() io.ReadCloser

GetMockDataUnauthorisedResponseMessage represents mock data for a github call that requires authentication

func GetMockDataUnauthorisedResponseStatusCode

func GetMockDataUnauthorisedResponseStatusCode() int

GetMockDataUnauthorisedResponseStatusCode represents a mocked status code for unauthorised access

func GetMockedContext

func GetMockedContext(request *http.Request, response *httptest.ResponseRecorder) (*gin.Context, *gin.Engine)

GetMockedContext returns a test context to be used in tests

func GetMockedContextWithParams

func GetMockedContextWithParams(request *http.Request, response *httptest.ResponseRecorder, params map[string]string) (*gin.Context, *gin.Engine)

GetMockedContextWithParams returns a test context to be used in tests with Params set to the key/value pairs in the provided map

Types

This section is empty.

Jump to

Keyboard shortcuts

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