コード例 #1
0
ファイル: test_outbound.py プロジェクト: linkedinyou/vumi-go
 def test_mk_inbound_push_trigger(self):
     conv = yield self.app_helper.create_conversation()
     msg = mk_inbound_push_trigger("to-addr-1", conv)
     self.assertEqual(msg[INBOUND_PUSH_TRIGGER], True)
     self.assertEqual(msg["content"], None)
     self.assertEqual(msg["transport_name"], None)
     self.assertEqual(msg["transport_type"], None)
     self.assertEqual(msg["from_addr"], "to-addr-1")
     self.assertEqual(msg["to_addr"], None)
     self.assertEqual(
         msg["helper_metadata"], {
             'go': {
                 'conversation_key': conv.key,
                 'conversation_type': u'dummy',
                 'user_account': u'test-0-user',
             },
         })
コード例 #2
0
 def test_mk_inbound_push_trigger(self):
     conv = yield self.app_helper.create_conversation()
     msg = mk_inbound_push_trigger(
         "to-addr-1", conv)
     self.assertEqual(msg[INBOUND_PUSH_TRIGGER], True)
     self.assertEqual(msg["content"], None)
     self.assertEqual(msg["transport_name"], None)
     self.assertEqual(msg["transport_type"], None)
     self.assertEqual(msg["from_addr"], "to-addr-1")
     self.assertEqual(msg["to_addr"], None)
     self.assertEqual(msg["helper_metadata"], {
         'go': {
             'conversation_key': conv.key,
             'conversation_type': u'dummy',
             'user_account': u'test-0-user',
         },
     })
コード例 #3
0
ファイル: test_outbound.py プロジェクト: linkedinyou/vumi-go
 def make_push_trigger(self, to_addr, conv):
     msg = mk_inbound_push_trigger(to_addr, conv)
     self.app_worker.add_inbound_message(msg)
     return msg
コード例 #4
0
ファイル: jsbox_send.py プロジェクト: TouK/vumi-go
 def send_inbound_push_trigger(self, to_addr, conversation):
     self.emit('Starting %r [%s] -> %s' % (
         conversation.name, conversation.key, to_addr))
     msg = mk_inbound_push_trigger(to_addr, conversation)
     return self.send_to_conv(conversation, msg)
コード例 #5
0
 def make_push_trigger(self, to_addr, conv):
     msg = mk_inbound_push_trigger(to_addr, conv)
     self.app_worker.add_inbound_message(msg)
     return msg
コード例 #6
0
ファイル: vumi_app.py プロジェクト: ChrisNolan1992/vumi-go
 def send_inbound_push_trigger(self, to_addr, conversation):
     log.debug('Starting %r -> %s' % (conversation, to_addr))
     msg = mk_inbound_push_trigger(to_addr, conversation)
     return self.consume_user_message(msg)
コード例 #7
0
ファイル: jsbox_send.py プロジェクト: linkedinyou/vumi-go
 def send_inbound_push_trigger(self, to_addr, conversation):
     self.emit('Starting %r [%s] -> %s' %
               (conversation.name, conversation.key, to_addr))
     msg = mk_inbound_push_trigger(to_addr, conversation)
     return self.send_to_conv(conversation, msg)
コード例 #8
0
 def send_inbound_push_trigger(self, to_addr, conversation):
     log.debug('Starting %r -> %s' % (conversation, to_addr))
     msg = mk_inbound_push_trigger(to_addr, conversation)
     return self.consume_user_message(msg)