Esempio n. 1
0
 def test_call_process_market_book_raise(self, mock_config):
     mock_config.raise_errors = True
     mock_strategy = mock.Mock(side_effect=ZeroDivisionError)
     mock_market = mock.Mock()
     mock_market_book = mock.Mock()
     with self.assertRaises(ZeroDivisionError):
         utils.call_process_market_book(mock_strategy, mock_market, mock_market_book)
Esempio n. 2
0
 def test_call_process_market_book_flumine_error(self):
     mock_strategy = mock.Mock(side_effect=FlumineException)
     mock_market = mock.Mock()
     mock_market_book = mock.Mock()
     utils.call_process_market_book(mock_strategy, mock_market,
                                    mock_market_book)
     mock_strategy.assert_called_with(mock_market, mock_market_book)
Esempio n. 3
0
 def test_call_process_market_book_error(self):
     mock_strategy = mock.Mock(side_effect=ZeroDivisionError)
     mock_market = mock.Mock()
     mock_market_book = mock.Mock()
     utils.call_process_market_book(mock_strategy, mock_market,
                                    mock_market_book)
     mock_strategy.assert_called_with(mock_market, mock_market_book)
Esempio n. 4
0
 def test_call_process_market_book(self):
     mock_strategy = mock.Mock()
     mock_market = mock.Mock()
     mock_market_book = mock.Mock()
     utils.call_process_market_book(mock_strategy, mock_market,
                                    mock_market_book)
     mock_strategy.assert_called_with(mock_market, mock_market_book)