MCPcopy Create free account
hub / github.com/doraemonext/wechat-python-sdk / test_response_image

Method test_response_image

tests/test_basic.py:529–539  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

527 self.assertEqual(response_5['xml']['Content'], '<h1>你好</h1>')
528
529 def test_response_image(self):
530 wechat = WechatBasic()
531 wechat.parse_data(data=self.test_message)
532
533 resp_xml = wechat.response_image(media_id='xurkvi9gl')
534 resp = xmltodict.parse(resp_xml)
535
536 self.assertEqual(resp['xml']['ToUserName'], 'fromUser')
537 self.assertEqual(resp['xml']['FromUserName'], 'toUser')
538 self.assertEqual(resp['xml']['MsgType'], 'image')
539 self.assertEqual(resp['xml']['Image']['MediaId'], 'xurkvi9gl')
540
541 def test_response_voice(self):
542 wechat = WechatBasic()

Callers

nothing calls this directly

Calls 3

parse_dataMethod · 0.95
response_imageMethod · 0.95
WechatBasicClass · 0.90

Tested by

no test coverage detected