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

Function TestAppScriptServiceUsesRuntimeFactory

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

Source from the content-addressed store, hash-verified

532}
533
534func TestAppScriptServiceUsesRuntimeFactory(t *testing.T) {
535 t.Parallel()
536
537 want := &scriptapi.Service{}
538 var gotAccount string
539 runtime := &app.Runtime{Services: app.Services{
540 AppScript: func(_ context.Context, account string) (*scriptapi.Service, error) {
541 gotAccount = account
542 return want, nil
543 },
544 }}
545 ctx := app.WithRuntime(context.Background(), runtime)
546
547 got, err := appScriptService(ctx, "test@example.com")
548 if err != nil {
549 t.Fatalf("appScriptService() error = %v", err)
550 }
551 if got != want {
552 t.Fatalf("appScriptService() = %p, want %p", got, want)
553 }
554 if gotAccount != "test@example.com" {
555 t.Fatalf("factory account = %q, want test@example.com", gotAccount)
556 }
557}
558
559func TestCloudIdentityServiceUsesRuntimeFactory(t *testing.T) {
560 t.Parallel()

Callers

nothing calls this directly

Calls 2

WithRuntimeFunction · 0.92
appScriptServiceFunction · 0.85

Tested by

no test coverage detected