本文整理汇总了Python中smpp.pdu_builder.DeliverSM.add_message_payload方法的典型用法代码示例。如果您正苦于以下问题:Python DeliverSM.add_message_payload方法的具体用法?Python DeliverSM.add_message_payload怎么用?Python DeliverSM.add_message_payload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类smpp.pdu_builder.DeliverSM
的用法示例。
在下文中一共展示了DeliverSM.add_message_payload方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_deliver_sm_message_payload
# 需要导入模块: from smpp.pdu_builder import DeliverSM [as 别名]
# 或者: from smpp.pdu_builder.DeliverSM import add_message_payload [as 别名]
def test_deliver_sm_message_payload(self):
"""A message in the `message_payload` field should be delivered."""
esme = yield self.get_esme(
deliver_sm=self.assertion_cb(u'hello', 'short_message'))
sm = DeliverSM(1, short_message='')
sm.add_message_payload(''.join('%02x' % ord(c) for c in 'hello'))
yield esme.handle_deliver_sm(unpack_pdu(sm.get_bin()))
示例2: test_deliver_sm_delivery_report_regex_fallback_ucs2_long
# 需要导入模块: from smpp.pdu_builder import DeliverSM [as 别名]
# 或者: from smpp.pdu_builder.DeliverSM import add_message_payload [as 别名]
def test_deliver_sm_delivery_report_regex_fallback_ucs2_long(self):
esme = yield self.get_esme(delivery_report=self.assertion_cb({
'message_id': '1b1720be-5f48-41c4-b3f8-6e59dbf45366',
'message_state': 'DELIVRD',
}))
dr_text = (
u'id:1b1720be-5f48-41c4-b3f8-6e59dbf45366 sub:001 dlvrd:001 '
u'submit date:120726132548 done date:120726132548 stat:DELIVRD '
u'err:000 text:').encode('utf-16be')
sm = DeliverSM(1, short_message='', data_coding=8)
sm.add_message_payload(dr_text.encode('hex'))
yield esme.handle_deliver_sm(unpack_pdu(sm.get_bin()))