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

Function TestVersionDoesNotRequireLayoutResolution

internal/cmd/root_more_test.go:279–305  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

277}
278
279func TestVersionDoesNotRequireLayoutResolution(t *testing.T) {
280 t.Parallel()
281
282 unavailable := func() (string, error) {
283 return "", errors.New("directory unavailable")
284 }
285 runtime := &app.Runtime{
286 LayoutResolver: config.NewResolver(config.Env{}, config.UserDirs{
287 GOOS: "linux",
288 HomeDir: unavailable,
289 ConfigDir: unavailable,
290 CacheDir: unavailable,
291 }),
292 KeyringOptions: testKeyringOptions(),
293 }
294 result := executeWithTestRuntime(t, []string{"--json", "version"}, runtime)
295 if result.err != nil {
296 t.Fatalf("version: %v\nstderr=%q", result.err, result.stderr)
297 }
298 var payload map[string]any
299 if err := json.Unmarshal([]byte(result.stdout), &payload); err != nil {
300 t.Fatalf("version JSON: %v\nstdout=%q", err, result.stdout)
301 }
302 if payload["version"] == "" {
303 t.Fatalf("version payload = %#v", payload)
304 }
305}
306
307func TestEnableCommandsBlocks(t *testing.T) {
308 err := Execute([]string{"--enable-commands", "calendar", "tasks", "list", "l1"})

Callers

nothing calls this directly

Calls 3

NewResolverFunction · 0.92
testKeyringOptionsFunction · 0.85
executeWithTestRuntimeFunction · 0.85

Tested by

no test coverage detected