def test_get_positoin(self): board = PriceBoardDB() board.set_origin_time(1000) board.set_center_price(1000) x, y = board.get_position(999, 1000.5) self.assertEqual(x, 1) self.assertEqual(y, 17) x, y = board.get_position(1000, 1000) self.assertEqual(x,0) self.assertEqual(y, 16)
def test_current_time(self): board = PriceBoardDB() board.set_origin_time(1000) time = board.get_origin_time() self.assertEqual(1000, time)