MCPcopy
hub / github.com/tinode/chat / TestDispatchUnsupportedVersion

Function TestDispatchUnsupportedVersion

server/session_test.go:121–142  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

119}
120
121func TestDispatchUnsupportedVersion(t *testing.T) {
122 s := &Session{
123 send: make(chan any, 10),
124 uid: types.Uid(1),
125 authLvl: auth.LevelAuth,
126 }
127 wg := sync.WaitGroup{}
128 r := responses{}
129 wg.Add(1)
130 go s.testWriteLoop(&r, &wg)
131 msg := &ClientComMessage{
132 Hi: &MsgClientHi{
133 Id: "123",
134 // Invalid version string.
135 Version: "0.1",
136 },
137 }
138 s.dispatch(msg)
139 close(s.send)
140 wg.Wait()
141 verifyResponseCodes(&r, []int{http.StatusHTTPVersionNotSupported}, t)
142}
143
144func TestDispatchLogin(t *testing.T) {
145 ctrl := gomock.NewController(t)

Callers

nothing calls this directly

Calls 6

testWriteLoopMethod · 0.95
dispatchMethod · 0.95
UidTypeAlias · 0.92
verifyResponseCodesFunction · 0.85
WaitMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…