MCPcopy
hub / github.com/wechatpy/wechatpy / test_pic_photo_or_album_event

Method test_pic_photo_or_album_event

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

Source from the content-addressed store, hash-verified

78 )
79
80 def test_pic_photo_or_album_event(self):
81 from wechatpy.events import PicPhotoOrAlbumEvent
82
83 xml = """<xml>
84 <ToUserName><![CDATA[gh_e136c6e50636]]></ToUserName>
85 <FromUserName><![CDATA[oMgHVjngRipVsoxg6TuX3vz6glDg]]></FromUserName>
86 <CreateTime>1408090816</CreateTime>
87 <MsgType><![CDATA[event]]></MsgType>
88 <Event><![CDATA[pic_photo_or_album]]></Event>
89 <EventKey><![CDATA[6]]></EventKey>
90 <SendPicsInfo><Count>1</Count>
91 <PicList>
92 <item>
93 <PicMd5Sum><![CDATA[5a75aaca956d97be686719218f275c6b]]></PicMd5Sum>
94 </item>
95 </PicList>
96 </SendPicsInfo>
97 </xml>"""
98
99 event = parse_message(xml)
100
101 self.assertTrue(isinstance(event, PicPhotoOrAlbumEvent))
102 self.assertEqual(1, event.count)
103 self.assertEqual(
104 '5a75aaca956d97be686719218f275c6b',
105 event.pictures[0]['PicMd5Sum']
106 )
107
108 def test_pic_wechat_event(self):
109 from wechatpy.events import PicWeChatEvent

Callers

nothing calls this directly

Calls 1

parse_messageFunction · 0.90

Tested by

no test coverage detected