本文整理匯總了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()))