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

Function TestCreateSessionRequest_RequestMCPApps

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

Source from the content-addressed store, hash-verified

1989}
1990
1991func TestCreateSessionRequest_RequestMCPApps(t *testing.T) {
1992 t.Run("sends requestMCPApps flag when EnableMCPApps is set", func(t *testing.T) {
1993 req := createSessionRequest{
1994 RequestMCPApps: Bool(true),
1995 }
1996 data, err := json.Marshal(req)
1997 if err != nil {
1998 t.Fatalf("Failed to marshal: %v", err)
1999 }
2000 var m map[string]any
2001 if err := json.Unmarshal(data, &m); err != nil {
2002 t.Fatalf("Failed to unmarshal: %v", err)
2003 }
2004 if m["requestMcpApps"] != true {
2005 t.Errorf("Expected requestMcpApps to be true, got %v", m["requestMcpApps"])
2006 }
2007 })
2008
2009 t.Run("does not send requestMcpApps when EnableMCPApps is unset", func(t *testing.T) {
2010 req := createSessionRequest{}
2011 data, _ := json.Marshal(req)
2012 var m map[string]any
2013 json.Unmarshal(data, &m)
2014 if _, ok := m["requestMcpApps"]; ok {
2015 t.Error("Expected requestMcpApps to be omitted when not set")
2016 }
2017 })
2018}
2019
2020func TestResumeSessionRequest_RequestMCPApps(t *testing.T) {
2021 t.Run("sends requestMcpApps flag when EnableMCPApps is set", func(t *testing.T) {

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…