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

Function TestSlidesServiceUsesRuntimeFactory

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

Source from the content-addressed store, hash-verified

904}
905
906func TestSlidesServiceUsesRuntimeFactory(t *testing.T) {
907 t.Parallel()
908
909 want := &slides.Service{}
910 var gotAccount string
911 runtime := &app.Runtime{Services: app.Services{
912 Slides: func(_ context.Context, account string) (*slides.Service, error) {
913 gotAccount = account
914 return want, nil
915 },
916 }}
917 ctx := app.WithRuntime(context.Background(), runtime)
918
919 got, err := slidesService(ctx, "test@example.com")
920 if err != nil {
921 t.Fatalf("slidesService() error = %v", err)
922 }
923 if got != want {
924 t.Fatalf("slidesService() = %p, want %p", got, want)
925 }
926 if gotAccount != "test@example.com" {
927 t.Fatalf("factory account = %q, want test@example.com", gotAccount)
928 }
929}
930
931func TestRequireGmailServiceUsesRuntimeFactory(t *testing.T) {
932 t.Parallel()

Callers

nothing calls this directly

Calls 2

WithRuntimeFunction · 0.92
slidesServiceFunction · 0.85

Tested by

no test coverage detected