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

Function TestCreateSessionRequest_RequestElicitation

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

Source from the content-addressed store, hash-verified

1894}
1895
1896func TestCreateSessionRequest_RequestElicitation(t *testing.T) {
1897 t.Run("sends requestElicitation flag when OnElicitationRequest is provided", func(t *testing.T) {
1898 req := createSessionRequest{
1899 RequestElicitation: Bool(true),
1900 }
1901 data, err := json.Marshal(req)
1902 if err != nil {
1903 t.Fatalf("Failed to marshal: %v", err)
1904 }
1905 var m map[string]any
1906 if err := json.Unmarshal(data, &m); err != nil {
1907 t.Fatalf("Failed to unmarshal: %v", err)
1908 }
1909 if m["requestElicitation"] != true {
1910 t.Errorf("Expected requestElicitation to be true, got %v", m["requestElicitation"])
1911 }
1912 })
1913
1914 t.Run("does not send requestElicitation when no handler provided", func(t *testing.T) {
1915 req := createSessionRequest{}
1916 data, _ := json.Marshal(req)
1917 var m map[string]any
1918 json.Unmarshal(data, &m)
1919 if _, ok := m["requestElicitation"]; ok {
1920 t.Error("Expected requestElicitation to be omitted when not set")
1921 }
1922 })
1923}
1924
1925func TestCreateSessionRequest_ModeCallbackFlags(t *testing.T) {
1926 t.Run("sends mode callback flags when handlers are provided", 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…