'Test that when we receive an intro request with a orders bloom filter, we send an order sync back'

@blocking_call_on_reactor_thread
def test_on_introduction_request(self):

    def on_send_offer_sync(_, tick):
        self.assertIsInstance(tick, Tick)
        on_send_offer_sync.called = True
    on_send_offer_sync.called = False
    candidate = WalkCandidate(('127.0.0.1', 1234), False, ('127.0.0.1', 1234), ('127.0.0.1', 1234), u'public')
    candidate.associate(self.market_community.my_member)
    payload = self.market_community.create_introduction_request(candidate, True).payload
    self.market_community.order_book.insert_ask(self.ask)
    self.market_community.order_book.insert_bid(self.bid)
    self.market_community.update_ip(TraderId('0'), ('127.0.0.1', 1234))
    self.market_community.update_ip(TraderId('1'), ('127.0.0.1', 1234))
    self.market_community.send_offer_sync = on_send_offer_sync
    message = MockObject()
    message.payload = payload
    message.candidate = candidate
    self.market_community.on_introduction_request([message])
    self.assertTrue(on_send_offer_sync.called)
