MCPcopy Create free account
hub / github.com/github/copilot-sdk / TestResumeSessionRequest_RequestMCPApps

Function TestResumeSessionRequest_RequestMCPApps

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

Source from the content-addressed store, hash-verified

2018}
2019
2020func TestResumeSessionRequest_RequestMCPApps(t *testing.T) {
2021 t.Run("sends requestMcpApps flag when EnableMCPApps is set", func(t *testing.T) {
2022 req := resumeSessionRequest{
2023 SessionID: "s1",
2024 RequestMCPApps: Bool(true),
2025 }
2026 data, err := json.Marshal(req)
2027 if err != nil {
2028 t.Fatalf("Failed to marshal: %v", err)
2029 }
2030 var m map[string]any
2031 if err := json.Unmarshal(data, &m); err != nil {
2032 t.Fatalf("Failed to unmarshal: %v", err)
2033 }
2034 if m["requestMcpApps"] != true {
2035 t.Errorf("Expected requestMcpApps to be true, got %v", m["requestMcpApps"])
2036 }
2037 })
2038
2039 t.Run("does not send requestMcpApps when RequestMCPApps is unset", func(t *testing.T) {
2040 req := resumeSessionRequest{SessionID: "s1"}
2041 data, _ := json.Marshal(req)
2042 var m map[string]any
2043 json.Unmarshal(data, &m)
2044 if _, ok := m["requestMcpApps"]; ok {
2045 t.Error("Expected requestMcpApps to be omitted when not set")
2046 }
2047 })
2048}
2049
2050func TestResumeSessionRequest_ModeCallbackFlags(t *testing.T) {
2051 req := resumeSessionRequest{

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…