github.com/kubeshop/testkube@v1.17.23/pkg/api/v1/client/mock_client.go (about) 1 package client 2 3 import "time" 4 5 // MockCopyFileAPI is the mock API client for uploading files to be used in tests 6 type MockCopyFileAPI struct { 7 UploadFileFn func(parentName string, parentType TestingType, filePath string, fileContent []byte, timeout time.Duration) error 8 } 9 10 func (m *MockCopyFileAPI) UploadFile(parentName string, parentType TestingType, filePath string, fileContent []byte, timeout time.Duration) error { 11 if m.UploadFileFn == nil { 12 panic("not implemented") 13 } 14 return m.UploadFileFn(parentName, parentType, filePath, fileContent, timeout) 15 16 }