MCPcopy Index your code
hub / github.com/offu/WeRoBot / test_voice_message

Function test_voice_message

tests/test_parser.py:103–125  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

101
102
103def test_voice_message():
104 message = parse_user_msg(
105 """
106 <xml>
107 <ToUserName><![CDATA[toUser]]></ToUserName>
108 <FromUserName><![CDATA[fromUser]]></FromUserName>
109 <CreateTime>1357290913</CreateTime>
110 <MsgType><![CDATA[voice]]></MsgType>
111 <MediaId><![CDATA[media_id]]></MediaId>
112 <Format><![CDATA[Format]]></Format>
113 <Recognition><![CDATA[Meow~]]></Recognition>
114 <MsgId>1234567890123456</MsgId>
115 </xml>
116 """
117 )
118 assert message.target == "toUser"
119 assert message.source == "fromUser"
120 assert message.time == 1357290913
121 assert message.type == "voice"
122 assert message.media_id == "media_id"
123 assert message.format == "Format"
124 assert message.recognition == "Meow~"
125 assert message.message_id == 1234567890123456
126
127
128def test_unknown_message():

Callers

nothing calls this directly

Calls 1

parse_user_msgFunction · 0.90

Tested by

no test coverage detected