'Test whether the right operations happen when we receive an offer sync'

@blocking_call_on_reactor_thread
def test_on_offer_sync(self):

    self.assertEqual(len(self.market_community.order_book.asks), 0)
    self.assertEqual(len(self.market_community.order_book.bids), 0)
    self.market_community.update_ip(TraderId(self.market_community.mid), ('2.2.2.2', 2))
    self.market_community.on_offer_sync([self.get_offer_sync(self.ask)])
    self.assertEqual(len(self.market_community.order_book.asks), 1)
    self.market_community.order_book.remove_tick(self.ask.order_id)
    self.market_community.on_offer_sync([self.get_offer_sync(self.bid)])
    self.assertEqual(len(self.market_community.order_book.bids), 1)
