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

Function TestSession_ElicitationCapabilityGating

go/session_test.go:932–959  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

930}
931
932func TestSession_ElicitationCapabilityGating(t *testing.T) {
933 t.Run("elicitation errors when capability is missing", func(t *testing.T) {
934 session, cleanup := newTestSession()
935 defer cleanup()
936
937 err := session.assertElicitation()
938 if err == nil {
939 t.Fatal("Expected error when elicitation capability is missing")
940 }
941 expected := "elicitation is not supported"
942 if !strings.Contains(err.Error(), expected) {
943 t.Errorf("Expected error to contain %q, got %q", expected, err.Error())
944 }
945 })
946
947 t.Run("elicitation succeeds when capability is present", func(t *testing.T) {
948 session, cleanup := newTestSession()
949 defer cleanup()
950
951 session.setCapabilities(&SessionCapabilities{
952 UI: &UICapabilities{Elicitation: true},
953 })
954 err := session.assertElicitation()
955 if err != nil {
956 t.Errorf("Expected no error when elicitation capability is present, got %v", err)
957 }
958 })
959}
960
961func TestSession_ElicitationHandler(t *testing.T) {
962 t.Run("registerElicitationHandler stores handler", func(t *testing.T) {

Callers

nothing calls this directly

Calls 4

newTestSessionFunction · 0.85
assertElicitationMethod · 0.45
ErrorMethod · 0.45
setCapabilitiesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…