MCPcopy Index your code
hub / github.com/github/copilot-sdk / TestClient_SessionFSConfig

Function TestClient_SessionFSConfig

go/client_test.go:370–410  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

368}
369
370func TestClient_SessionFSConfig(t *testing.T) {
371 t.Run("should throw error when InitialWorkingDirectory is missing", func(t *testing.T) {
372 defer func() {
373 if r := recover(); r == nil {
374 t.Error("Expected panic for missing SessionFS.InitialWorkingDirectory")
375 } else {
376 matched, _ := regexp.MatchString("SessionFS.InitialWorkingDirectory is required", r.(string))
377 if !matched {
378 t.Errorf("Expected panic message to contain 'SessionFS.InitialWorkingDirectory is required', got: %v", r)
379 }
380 }
381 }()
382
383 NewClient(&ClientOptions{
384 SessionFS: &SessionFSConfig{
385 SessionStatePath: "/session-state",
386 Conventions: rpc.SessionFSSetProviderConventionsPosix,
387 },
388 })
389 })
390
391 t.Run("should throw error when SessionStatePath is missing", func(t *testing.T) {
392 defer func() {
393 if r := recover(); r == nil {
394 t.Error("Expected panic for missing SessionFS.SessionStatePath")
395 } else {
396 matched, _ := regexp.MatchString("SessionFS.SessionStatePath is required", r.(string))
397 if !matched {
398 t.Errorf("Expected panic message to contain 'SessionFS.SessionStatePath is required', got: %v", r)
399 }
400 }
401 }()
402
403 NewClient(&ClientOptions{
404 SessionFS: &SessionFSConfig{
405 InitialWorkingDirectory: "/",
406 Conventions: rpc.SessionFSSetProviderConventionsPosix,
407 },
408 })
409 })
410}
411
412func TestClient_AuthOptions(t *testing.T) {
413 t.Run("should accept GitHubToken option", func(t *testing.T) {

Callers

nothing calls this directly

Calls 2

NewClientFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…