@inlineCallbacks
def test_inbound_begin_with_close(self):
    (yield self.get_transport())
    ussd_string = '*code#'
    d = self.tx_helper.mk_request(request=ussd_string)
    [msg] = (yield self.tx_helper.wait_for_dispatched_inbound(1))
    self.assert_inbound_message(msg, session_event=TransportUserMessage.SESSION_NEW, content=None)
    reply_content = 'We are no longer the Knight who say Ni!'
    reply = msg.reply(reply_content, continue_session=False)
    self.tx_helper.dispatch_outbound(reply)
    response = (yield d)
    self.assert_outbound_message(response.delivered_body, reply_content, self.callback_url(ussd_string), continue_session=False)
    [ack] = (yield self.tx_helper.wait_for_dispatched_events(1))
    self.assert_ack(ack, reply)
@inlineCallbacks
def test_inbound_begin_with_close(self):
    (yield self.get_transport())
    ussd_string = '*code#'
    d = self.tx_helper.mk_request(request=ussd_string)
    [msg] = (yield self.tx_helper.wait_for_dispatched_inbound(1))
    self.assert_inbound_message(msg, session_event=TransportUserMessage.SESSION_NEW, content=None)
    reply_content = 'We are no longer the Knight who say Ni!'
    reply = msg.reply(reply_content, continue_session=False)
    self.tx_helper.dispatch_outbound(reply)
    response = (yield d)
    self.assert_outbound_message(response.delivered_body, reply_content, self.callback_url(ussd_string), continue_session=False)
    [ack] = (yield self.tx_helper.wait_for_dispatched_events(1))
    self.assert_ack(ack, reply)