mirror of
https://github.com/cupcakearmy/autorestic.git
synced 2026-04-06 13:49:18 +00:00
ai testing
This commit is contained in:
20
internal/mock_executor_test.go
Normal file
20
internal/mock_executor_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package internal
|
||||
|
||||
type MockExecutor struct {
|
||||
ExecuteFunc func(options ExecuteOptions, args ...string) (int, string, error)
|
||||
ExecuteResticFunc func(options ExecuteOptions, args ...string) (int, string, error)
|
||||
}
|
||||
|
||||
func (m *MockExecutor) Execute(options ExecuteOptions, args ...string) (int, string, error) {
|
||||
if m.ExecuteFunc != nil {
|
||||
return m.ExecuteFunc(options, args...)
|
||||
}
|
||||
return 0, "", nil
|
||||
}
|
||||
|
||||
func (m *MockExecutor) ExecuteRestic(options ExecuteOptions, args ...string) (int, string, error) {
|
||||
if m.ExecuteResticFunc != nil {
|
||||
return m.ExecuteResticFunc(options, args...)
|
||||
}
|
||||
return 0, "", nil
|
||||
}
|
||||
Reference in New Issue
Block a user