MCPcopy
hub / github.com/wechatpy/wechatpy / test_kf_create_session_event

Method test_kf_create_session_event

tests/test_events.py:185–199  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

183 self.assertEqual('10001:1000012;10002:100021', event.sku_info)
184
185 def test_kf_create_session_event(self):
186 from wechatpy.events import KfCreateSessionEvent
187
188 xml = """<xml>
189 <ToUserName><![CDATA[touser]]></ToUserName>
190 <FromUserName><![CDATA[fromuser]]></FromUserName>
191 <CreateTime>1399197672</CreateTime>
192 <MsgType><![CDATA[event]]></MsgType>
193 <Event><![CDATA[kf_create_session]]></Event>
194 <KfAccount><![CDATA[test1@test]]></KfAccount>
195 </xml>"""
196
197 event = parse_message(xml)
198 self.assertTrue(isinstance(event, KfCreateSessionEvent))
199 self.assertEqual('test1@test', event.account)
200
201 def test_kf_close_session_event(self):
202 from wechatpy.events import KfCloseSessionEvent

Callers

nothing calls this directly

Calls 1

parse_messageFunction · 0.90

Tested by

no test coverage detected