def test_call_check_market_raise(self, mock_config): mock_config.raise_errors = True mock_strategy_check = mock.Mock(side_effect=ValueError) mock_market = mock.Mock() mock_market_book = mock.Mock() with self.assertRaises(ValueError): utils.call_check_market(mock_strategy_check, mock_market, mock_market_book)
def test_call_check_market(self): mock_strategy_check = mock.Mock() mock_market = mock.Mock() mock_market_book = mock.Mock() utils.call_check_market(mock_strategy_check, mock_market, mock_market_book) mock_strategy_check.assert_called_with(mock_market, mock_market_book)
def test_call_check_market_error(self): mock_strategy_check = mock.Mock(side_effect=ValueError) mock_market = mock.Mock() mock_market_book = mock.Mock() self.assertFalse( utils.call_check_market(mock_strategy_check, mock_market, mock_market_book) ) mock_strategy_check.assert_called_with(mock_market, mock_market_book)
def test_call_check_market_flumine_error(self): mock_strategy_check = mock.Mock(side_effect=FlumineException) mock_market = mock.Mock() mock_market_book = mock.Mock() self.assertFalse( utils.call_check_market(mock_strategy_check, mock_market, mock_market_book) ) mock_strategy_check.assert_called_with(mock_market, mock_market_book)