// MockEvalSymlinks replaces the path/filepath.EvalSymlinks function used inside the caps package. func MockEvalSymlinks(test *testutil.BaseTest, fn func(string) (string, error)) { orig := evalSymlinks evalSymlinks = fn test.AddCleanup(func() { evalSymlinks = orig }) }
// MockDefaultRetryStrategy mocks the retry strategy used by several store requests func MockDefaultRetryStrategy(t *testutil.BaseTest, strategy retry.Strategy) { originalDefaultRetryStrategy := defaultRetryStrategy defaultRetryStrategy = strategy t.AddCleanup(func() { defaultRetryStrategy = originalDefaultRetryStrategy }) }
// MockProfilesPath mocks the file read by LoadedProfiles() func MockProfilesPath(t *testutil.BaseTest, profiles string) { profilesPath = profiles t.AddCleanup(func() { profilesPath = realProfilesPath }) }