( ctx context.Context, svc *drive.Service, download app.DriveDownloadFunc, export app.DriveExportFunc, )
| 40 | } |
| 41 | |
| 42 | func withDriveTestOperations( |
| 43 | ctx context.Context, |
| 44 | svc *drive.Service, |
| 45 | download app.DriveDownloadFunc, |
| 46 | export app.DriveExportFunc, |
| 47 | ) context.Context { |
| 48 | if ctx == nil { |
| 49 | ctx = context.Background() |
| 50 | } |
| 51 | runtime := &app.Runtime{} |
| 52 | if existing, ok := app.FromContext(ctx); ok { |
| 53 | *runtime = *existing |
| 54 | } |
| 55 | runtime.Services.Drive = stubDriveService(svc) |
| 56 | runtime.Services.DriveDownload = download |
| 57 | runtime.Services.DriveExport = export |
| 58 | return app.WithRuntime(ctx, runtime) |
| 59 | } |
| 60 | |
| 61 | func executeWithDriveTestService(t *testing.T, args []string, svc *drive.Service) executeTestResult { |
| 62 | t.Helper() |
no test coverage detected