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

Function TestAnalyticsDataServiceUsesRuntimeFactory

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

Source from the content-addressed store, hash-verified

729}
730
731func TestAnalyticsDataServiceUsesRuntimeFactory(t *testing.T) {
732 t.Parallel()
733
734 want := &analyticsdata.Service{}
735 var gotAccount string
736 runtime := &app.Runtime{Services: app.Services{
737 AnalyticsData: func(_ context.Context, account string) (*analyticsdata.Service, error) {
738 gotAccount = account
739 return want, nil
740 },
741 }}
742 ctx := app.WithRuntime(context.Background(), runtime)
743
744 got, err := analyticsDataService(ctx, "test@example.com")
745 if err != nil {
746 t.Fatalf("analyticsDataService() error = %v", err)
747 }
748 if got != want {
749 t.Fatalf("analyticsDataService() = %p, want %p", got, want)
750 }
751 if gotAccount != "test@example.com" {
752 t.Fatalf("factory account = %q, want test@example.com", gotAccount)
753 }
754}
755
756func TestSearchConsoleServiceUsesRuntimeFactory(t *testing.T) {
757 t.Parallel()

Callers

nothing calls this directly

Calls 2

WithRuntimeFunction · 0.92
analyticsDataServiceFunction · 0.85

Tested by

no test coverage detected