Пример #1
0
    def test_send_request_call_raise_exception_UserWarning_when_market_is_invalid(
            self):
        trader = SimulationTrader()
        trader.is_initialized = True
        trader.market = "make exception"

        with self.assertRaises(UserWarning):
            trader.send_request(None, None)
Пример #2
0
    def test_get_account_info_call_raise_exception_UserWarning_when_market_is_invalid(
        self, ):
        trader = SimulationTrader()
        trader.is_initialized = True
        trader.market = "make exception"

        with self.assertRaises(UserWarning):
            trader.get_account_info()
Пример #3
0
    def test_initialize_simulation_set_is_initialized_False_when_invalid_market(
            self):
        trader = SimulationTrader()
        trader.market = "make exception"
        with self.assertRaises(AttributeError):
            trader.initialize_simulation("mango", 500, 5000)

        self.assertEqual(trader.is_initialized, False)