MCPcopy Create free account
hub / github.com/openclaw/gogcli / TestDriveServiceUsesRuntimeFactory

Function TestDriveServiceUsesRuntimeFactory

internal/cmd/runtime_test.go:781–804  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

779}
780
781func TestDriveServiceUsesRuntimeFactory(t *testing.T) {
782 t.Parallel()
783
784 want := &drive.Service{}
785 var gotAccount string
786 runtime := &app.Runtime{Services: app.Services{
787 Drive: func(_ context.Context, account string) (*drive.Service, error) {
788 gotAccount = account
789 return want, nil
790 },
791 }}
792 ctx := app.WithRuntime(context.Background(), runtime)
793
794 got, err := driveService(ctx, "test@example.com")
795 if err != nil {
796 t.Fatalf("driveService() error = %v", err)
797 }
798 if got != want {
799 t.Fatalf("driveService() = %p, want %p", got, want)
800 }
801 if gotAccount != "test@example.com" {
802 t.Fatalf("factory account = %q, want test@example.com", gotAccount)
803 }
804}
805
806func TestDriveActivityServiceUsesRuntimeFactory(t *testing.T) {
807 t.Parallel()

Callers

nothing calls this directly

Calls 2

WithRuntimeFunction · 0.92
driveServiceFunction · 0.85

Tested by

no test coverage detected