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

Function TestResumeSessionRequest_RequestElicitation

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

Source from the content-addressed store, hash-verified

1959}
1960
1961func TestResumeSessionRequest_RequestElicitation(t *testing.T) {
1962 t.Run("sends requestElicitation flag when OnElicitationRequest is provided", func(t *testing.T) {
1963 req := resumeSessionRequest{
1964 SessionID: "s1",
1965 RequestElicitation: Bool(true),
1966 }
1967 data, err := json.Marshal(req)
1968 if err != nil {
1969 t.Fatalf("Failed to marshal: %v", err)
1970 }
1971 var m map[string]any
1972 if err := json.Unmarshal(data, &m); err != nil {
1973 t.Fatalf("Failed to unmarshal: %v", err)
1974 }
1975 if m["requestElicitation"] != true {
1976 t.Errorf("Expected requestElicitation to be true, got %v", m["requestElicitation"])
1977 }
1978 })
1979
1980 t.Run("does not send requestElicitation when no handler provided", func(t *testing.T) {
1981 req := resumeSessionRequest{SessionID: "s1"}
1982 data, _ := json.Marshal(req)
1983 var m map[string]any
1984 json.Unmarshal(data, &m)
1985 if _, ok := m["requestElicitation"]; ok {
1986 t.Error("Expected requestElicitation to be omitted when not set")
1987 }
1988 })
1989}
1990
1991func TestCreateSessionRequest_RequestMCPApps(t *testing.T) {
1992 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…