'Test addition, retrieval and deletion of ticks in the database'

@blocking_call_on_reactor_thread
def test_add_remove_tick(self):

    ask = Tick.from_order(self.order1, MessageId(TraderId('0'), MessageNumber('message_number')))
    self.database.add_tick(ask)
    bid = Tick.from_order(self.order2, MessageId(TraderId('0'), MessageNumber('message_number')))
    self.database.add_tick(bid)
    self.assertEqual(len(self.database.get_ticks()), 2)
    self.database.delete_all_ticks()
    self.assertEqual(len(self.database.get_ticks()), 0)
