test

package
v0.0.0-...-781ef27 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisableLogging

func DisableLogging()

DisableLogger discards all logging

func NewDefaultConfig

func NewDefaultConfig() actuator.Configuration

func NewDefaultOriginalPullRequestEvent

func NewDefaultOriginalPullRequestEvent(number int, action string) *gh.PullRequestEvent

func NewDefaultTestEvent

func NewDefaultTestEvent() *github.Event

func NewTestEvent

func NewTestEvent(number int, action string, repoName string) *github.Event

Types

type MockEventHandler

type MockEventHandler struct {
	EventResponse   actuator.EventResponse
	EventWasHandled bool
	LastEvent       *github.Event
	Done            chan bool
}

func NewMockEventHandler

func NewMockEventHandler(message string) *MockEventHandler

func (*MockEventHandler) GetEventResponse

func (h *MockEventHandler) GetEventResponse(event *github.Event) *actuator.EventResponse

func (*MockEventHandler) HandleEvent

func (h *MockEventHandler) HandleEvent(event *github.Event)

type MockGithubClient

type MockGithubClient struct {
	LastComment *github.IssueComment
}

func NewMockGithubClient

func NewMockGithubClient() *MockGithubClient

func (*MockGithubClient) CreateComment

func (tgc *MockGithubClient) CreateComment(owner string, repo string, issueNumber int, body string) (*github.IssueComment, error)

CreateComment returns a fake comment and saves it as LastComment

type MockShell

type MockShell struct {
	OutputToReturn    string
	ErrorToReturn     error
	ReceivedArguments []string
}

func (*MockShell) RunWithArgs

func (s *MockShell) RunWithArgs(args ...string) (string, error)

type OpenshiftMock

type OpenshiftMock struct {
	AppliedTemplate   string
	AppliedLabels     openshift.ObjectLabels
	AppliedParameters openshift.TemplateParameters

	DeletedLabels openshift.ObjectLabels

	NewAppOutputToReturn    openshift.NewAppOutput
	DeleteAppOutputToReturn openshift.DeleteAppOutput
}

OpenshiftMock implements the OpenshiftClient interface to mock calls to the cli

func (*OpenshiftMock) DeleteApp

DeleteApp mocks the delte operation

func (*OpenshiftMock) GetURLForRoute

func (om *OpenshiftMock) GetURLForRoute(routeName string) (string, error)

GetURLForRoute turns the route into an url

func (*OpenshiftMock) NewAppFromTemplate

func (om *OpenshiftMock) NewAppFromTemplate(templateName string, templateParameters openshift.TemplateParameters, labels openshift.ObjectLabels) (*openshift.NewAppOutput, error)

NewAppFromTemplate mocks the apply template method and records the passed values

Jump to

Keyboard shortcuts

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