mock_Network.go 4.67 KB
Newer Older
Tomasz Maczukin's avatar
Tomasz Maczukin committed
1
// Code generated by mockery v1.0.0. DO NOT EDIT.
Lorenzo Villani's avatar
Lorenzo Villani committed
2 3

// This comment works around https://github.com/vektra/mockery/issues/155
Kamil Trzciński's avatar
Kamil Trzciński committed
4

Lorenzo Villani's avatar
Lorenzo Villani committed
5
package common
Kamil Trzciński's avatar
Kamil Trzciński committed
6

Lorenzo Villani's avatar
Lorenzo Villani committed
7 8
import io "io"
import mock "github.com/stretchr/testify/mock"
Kamil Trzciński's avatar
Kamil Trzciński committed
9

Lorenzo Villani's avatar
Lorenzo Villani committed
10
// MockNetwork is an autogenerated mock type for the Network type
Kamil Trzciński's avatar
Kamil Trzciński committed
11 12 13 14
type MockNetwork struct {
	mock.Mock
}

Lorenzo Villani's avatar
Lorenzo Villani committed
15 16 17
// DownloadArtifacts provides a mock function with given fields: config, artifactsFile
func (_m *MockNetwork) DownloadArtifacts(config JobCredentials, artifactsFile string) DownloadState {
	ret := _m.Called(config, artifactsFile)
Kamil Trzciński's avatar
Kamil Trzciński committed
18

Lorenzo Villani's avatar
Lorenzo Villani committed
19 20 21 22 23
	var r0 DownloadState
	if rf, ok := ret.Get(0).(func(JobCredentials, string) DownloadState); ok {
		r0 = rf(config, artifactsFile)
	} else {
		r0 = ret.Get(0).(DownloadState)
Kamil Trzciński's avatar
Kamil Trzciński committed
24 25 26 27 28
	}

	return r0
}

29 30 31
// PatchTrace provides a mock function with given fields: config, jobCredentials, content, startOffset
func (_m *MockNetwork) PatchTrace(config RunnerConfig, jobCredentials *JobCredentials, content []byte, startOffset int) (int, UpdateState) {
	ret := _m.Called(config, jobCredentials, content, startOffset)
Lorenzo Villani's avatar
Lorenzo Villani committed
32

33 34 35 36 37 38 39 40 41 42 43 44 45
	var r0 int
	if rf, ok := ret.Get(0).(func(RunnerConfig, *JobCredentials, []byte, int) int); ok {
		r0 = rf(config, jobCredentials, content, startOffset)
	} else {
		r0 = ret.Get(0).(int)
	}

	var r1 UpdateState
	if rf, ok := ret.Get(1).(func(RunnerConfig, *JobCredentials, []byte, int) UpdateState); ok {
		r1 = rf(config, jobCredentials, content, startOffset)
	} else {
		r1 = ret.Get(1).(UpdateState)
	}
Kamil Trzciński's avatar
Kamil Trzciński committed
46

47
	return r0, r1
Kamil Trzciński's avatar
Kamil Trzciński committed
48 49
}

Lorenzo Villani's avatar
Lorenzo Villani committed
50
// ProcessJob provides a mock function with given fields: config, buildCredentials
51
func (_m *MockNetwork) ProcessJob(config RunnerConfig, buildCredentials *JobCredentials) (JobTrace, error) {
Lorenzo Villani's avatar
Lorenzo Villani committed
52 53 54 55 56 57 58 59 60 61
	ret := _m.Called(config, buildCredentials)

	var r0 JobTrace
	if rf, ok := ret.Get(0).(func(RunnerConfig, *JobCredentials) JobTrace); ok {
		r0 = rf(config, buildCredentials)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(JobTrace)
		}
	}
Kamil Trzciński's avatar
Kamil Trzciński committed
62

63 64 65 66 67 68 69 70
	var r1 error
	if rf, ok := ret.Get(1).(func(RunnerConfig, *JobCredentials) error); ok {
		r1 = rf(config, buildCredentials)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
Kamil Trzciński's avatar
Kamil Trzciński committed
71
}
72

73 74 75
// RegisterRunner provides a mock function with given fields: config, parameters
func (_m *MockNetwork) RegisterRunner(config RunnerCredentials, parameters RegisterRunnerParameters) *RegisterRunnerResponse {
	ret := _m.Called(config, parameters)
Lorenzo Villani's avatar
Lorenzo Villani committed
76 77

	var r0 *RegisterRunnerResponse
78 79
	if rf, ok := ret.Get(0).(func(RunnerCredentials, RegisterRunnerParameters) *RegisterRunnerResponse); ok {
		r0 = rf(config, parameters)
Lorenzo Villani's avatar
Lorenzo Villani committed
80 81 82 83
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*RegisterRunnerResponse)
		}
84 85
	}

Lorenzo Villani's avatar
Lorenzo Villani committed
86
	return r0
87
}
Kamil Trzciński's avatar
Kamil Trzciński committed
88

89 90 91
// RequestJob provides a mock function with given fields: config, sessionInfo
func (_m *MockNetwork) RequestJob(config RunnerConfig, sessionInfo *SessionInfo) (*JobResponse, bool) {
	ret := _m.Called(config, sessionInfo)
Kamil Trzciński's avatar
Kamil Trzciński committed
92

Lorenzo Villani's avatar
Lorenzo Villani committed
93
	var r0 *JobResponse
94 95
	if rf, ok := ret.Get(0).(func(RunnerConfig, *SessionInfo) *JobResponse); ok {
		r0 = rf(config, sessionInfo)
Lorenzo Villani's avatar
Lorenzo Villani committed
96 97 98 99 100 101 102
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*JobResponse)
		}
	}

	var r1 bool
103 104
	if rf, ok := ret.Get(1).(func(RunnerConfig, *SessionInfo) bool); ok {
		r1 = rf(config, sessionInfo)
Lorenzo Villani's avatar
Lorenzo Villani committed
105 106 107 108 109
	} else {
		r1 = ret.Get(1).(bool)
	}

	return r0, r1
Kamil Trzciński's avatar
Kamil Trzciński committed
110 111
}

Lorenzo Villani's avatar
Lorenzo Villani committed
112 113 114 115 116 117 118 119 120 121
// UnregisterRunner provides a mock function with given fields: config
func (_m *MockNetwork) UnregisterRunner(config RunnerCredentials) bool {
	ret := _m.Called(config)

	var r0 bool
	if rf, ok := ret.Get(0).(func(RunnerCredentials) bool); ok {
		r0 = rf(config)
	} else {
		r0 = ret.Get(0).(bool)
	}
Kamil Trzciński's avatar
Kamil Trzciński committed
122 123 124 125

	return r0
}

126
// UpdateJob provides a mock function with given fields: config, jobCredentials, jobInfo
127 128
func (_m *MockNetwork) UpdateJob(config RunnerConfig, jobCredentials *JobCredentials, jobInfo UpdateJobInfo) UpdateState {
	ret := _m.Called(config, jobCredentials, jobInfo)
Lorenzo Villani's avatar
Lorenzo Villani committed
129 130

	var r0 UpdateState
131 132
	if rf, ok := ret.Get(0).(func(RunnerConfig, *JobCredentials, UpdateJobInfo) UpdateState); ok {
		r0 = rf(config, jobCredentials, jobInfo)
Lorenzo Villani's avatar
Lorenzo Villani committed
133 134 135
	} else {
		r0 = ret.Get(0).(UpdateState)
	}
Kamil Trzciński's avatar
Kamil Trzciński committed
136 137 138 139

	return r0
}

Kamil Trzciński's avatar
Kamil Trzciński committed
140 141 142
// UploadRawArtifacts provides a mock function with given fields: config, reader, options
func (_m *MockNetwork) UploadRawArtifacts(config JobCredentials, reader io.Reader, options ArtifactsOptions) UploadState {
	ret := _m.Called(config, reader, options)
Lorenzo Villani's avatar
Lorenzo Villani committed
143 144

	var r0 UploadState
Kamil Trzciński's avatar
Kamil Trzciński committed
145 146
	if rf, ok := ret.Get(0).(func(JobCredentials, io.Reader, ArtifactsOptions) UploadState); ok {
		r0 = rf(config, reader, options)
Lorenzo Villani's avatar
Lorenzo Villani committed
147 148 149
	} else {
		r0 = ret.Get(0).(UploadState)
	}
Kamil Trzciński's avatar
Kamil Trzciński committed
150 151 152 153

	return r0
}

Lorenzo Villani's avatar
Lorenzo Villani committed
154 155 156 157 158 159 160 161 162 163
// VerifyRunner provides a mock function with given fields: config
func (_m *MockNetwork) VerifyRunner(config RunnerCredentials) bool {
	ret := _m.Called(config)

	var r0 bool
	if rf, ok := ret.Get(0).(func(RunnerCredentials) bool); ok {
		r0 = rf(config)
	} else {
		r0 = ret.Get(0).(bool)
	}
Kamil Trzciński's avatar
Kamil Trzciński committed
164 165 166

	return r0
}