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

Function TestSessionRequests_EnableConfigDiscovery

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

Source from the content-addressed store, hash-verified

698}
699
700func TestSessionRequests_EnableConfigDiscovery(t *testing.T) {
701 t.Run("create includes enableConfigDiscovery when true", func(t *testing.T) {
702 req := createSessionRequest{EnableConfigDiscovery: Bool(true)}
703 data, err := json.Marshal(req)
704 if err != nil {
705 t.Fatalf("Failed to marshal: %v", err)
706 }
707 var m map[string]any
708 if err := json.Unmarshal(data, &m); err != nil {
709 t.Fatalf("Failed to unmarshal: %v", err)
710 }
711 if m["enableConfigDiscovery"] != true {
712 t.Errorf("Expected enableConfigDiscovery to be true, got %v", m["enableConfigDiscovery"])
713 }
714 })
715
716 t.Run("create includes enableConfigDiscovery when false", func(t *testing.T) {
717 req := createSessionRequest{EnableConfigDiscovery: Bool(false)}
718 data, err := json.Marshal(req)
719 if err != nil {
720 t.Fatalf("Failed to marshal: %v", err)
721 }
722 var m map[string]any
723 if err := json.Unmarshal(data, &m); err != nil {
724 t.Fatalf("Failed to unmarshal: %v", err)
725 }
726 if m["enableConfigDiscovery"] != false {
727 t.Errorf("Expected enableConfigDiscovery to be false, got %v", m["enableConfigDiscovery"])
728 }
729 })
730
731 t.Run("create omits enableConfigDiscovery when unset", func(t *testing.T) {
732 req := createSessionRequest{}
733 data, _ := json.Marshal(req)
734 var m map[string]any
735 json.Unmarshal(data, &m)
736 if _, ok := m["enableConfigDiscovery"]; ok {
737 t.Error("Expected enableConfigDiscovery to be omitted when unset")
738 }
739 })
740
741 t.Run("resume includes enableConfigDiscovery when false", func(t *testing.T) {
742 req := resumeSessionRequest{SessionID: "s1", EnableConfigDiscovery: Bool(false)}
743 data, err := json.Marshal(req)
744 if err != nil {
745 t.Fatalf("Failed to marshal: %v", err)
746 }
747 var m map[string]any
748 if err := json.Unmarshal(data, &m); err != nil {
749 t.Fatalf("Failed to unmarshal: %v", err)
750 }
751 if m["enableConfigDiscovery"] != false {
752 t.Errorf("Expected enableConfigDiscovery to be false, got %v", m["enableConfigDiscovery"])
753 }
754 })
755
756 t.Run("resume omits enableConfigDiscovery when unset", func(t *testing.T) {
757 req := resumeSessionRequest{SessionID: "s1"}

Callers

nothing calls this directly

Calls 3

BoolFunction · 0.85
MarshalMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…