@inlineCallbacks
def test_metadata_handled(self):
    (yield self.get_transport({'provider_mappings': {'MTN': 'mtn'}}))
    ussd_session_id = 'xxxx'
    content = '*code#'
    d = self.tx_helper.mk_request(request=content, ussdSessionId=ussd_session_id)
    [msg] = (yield self.tx_helper.wait_for_dispatched_inbound(1))
    self.assert_inbound_message(msg, session_event=TransportUserMessage.SESSION_NEW, content=None, helper_metadata={'session_id': ussd_session_id}, transport_metadata={'aat_ussd': {'provider': 'mtn', 'ussd_session_id': ussd_session_id}})
    reply_content = 'We want ... a shrubbery!'
    reply = msg.reply(reply_content, continue_session=True)
    self.tx_helper.dispatch_outbound(reply)
    (yield d)
    [ack] = (yield self.tx_helper.wait_for_dispatched_events(1))
    self.assert_ack(ack, reply)
@inlineCallbacks
def test_metadata_handled(self):
    (yield self.get_transport({'provider_mappings': {'MTN': 'mtn'}}))
    ussd_session_id = 'xxxx'
    content = '*code#'
    d = self.tx_helper.mk_request(request=content, ussdSessionId=ussd_session_id)
    [msg] = (yield self.tx_helper.wait_for_dispatched_inbound(1))
    self.assert_inbound_message(msg, session_event=TransportUserMessage.SESSION_NEW, content=None, helper_metadata={'session_id': ussd_session_id}, transport_metadata={'aat_ussd': {'provider': 'mtn', 'ussd_session_id': ussd_session_id}})
    reply_content = 'We want ... a shrubbery!'
    reply = msg.reply(reply_content, continue_session=True)
    self.tx_helper.dispatch_outbound(reply)
    (yield d)
    [ack] = (yield self.tx_helper.wait_for_dispatched_events(1))
    self.assert_ack(ack, reply)