Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_order_limit(self):
self.assertEqual(self.order_package.order_limit(OrderPackageType.PLACE), 200)
self.assertEqual(self.order_package.order_limit(OrderPackageType.CANCEL), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.UPDATE), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.REPLACE), 60)
def test_order_limit(self):
self.assertEqual(self.order_package.order_limit(OrderPackageType.PLACE), 200)
self.assertEqual(self.order_package.order_limit(OrderPackageType.CANCEL), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.UPDATE), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.REPLACE), 60)
def test_order_limit(self):
self.assertEqual(self.order_package.order_limit(OrderPackageType.PLACE), 200)
self.assertEqual(self.order_package.order_limit(OrderPackageType.CANCEL), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.UPDATE), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.REPLACE), 60)
def test_init(self):
self.assertEqual(self.order_type.EXCHANGE, ExchangeType.BETFAIR)
self.assertEqual(self.order_type.ORDER_TYPE, OrderTypes.MARKET_ON_CLOSE)
self.assertEqual(self.order_type.liability, 128)
def test_init(self):
self.assertEqual(self.order_type.EXCHANGE, ExchangeType.BETFAIR)
self.assertEqual(self.order_type.ORDER_TYPE, OrderTypes.LIMIT)
self.assertEqual(self.order_type.price, 1.01)
self.assertEqual(self.order_type.size, 2)
self.assertEqual(self.order_type.persistence_type, "PERSIST")
self.assertEqual(self.order_type.time_in_force, "YES")
self.assertEqual(self.order_type.min_fill_size, 34.5)
self.assertEqual(self.order_type.bet_target_type, "NO")
self.assertEqual(self.order_type.bet_target_size, 2)
def test_init(self):
self.assertEqual(self.execution.EXCHANGE, ExchangeType.BETFAIR)
def test_order_limit(self):
self.assertEqual(self.order_package.order_limit(OrderPackageType.PLACE), 200)
self.assertEqual(self.order_package.order_limit(OrderPackageType.CANCEL), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.UPDATE), 60)
self.assertEqual(self.order_package.order_limit(OrderPackageType.REPLACE), 60)
def test_size_remaining_non_limit(self):
self.simulated.order.order_type.liability = 2
self.simulated.order.order_type.ORDER_TYPE = OrderTypes.LIMIT_ON_CLOSE
self.assertEqual(self.simulated.size_remaining, 0)
def test_init(self):
self.assertEqual(self.order_type.EXCHANGE, ExchangeType.BETFAIR)
self.assertEqual(self.order_type.ORDER_TYPE, OrderTypes.LIMIT_ON_CLOSE)
self.assertEqual(self.order_type.liability, 64)
self.assertEqual(self.order_type.price, 1.01)
def test__update_status(self, mock_info):
self.order._update_status(OrderStatus.EXECUTION_COMPLETE)
self.assertEqual(self.order.status_log, [OrderStatus.EXECUTION_COMPLETE])
self.assertEqual(self.order.status, OrderStatus.EXECUTION_COMPLETE)