From 5321200c05b3b693581ec4238c74eb02e0b715d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 8 May 2018 21:00:27 +0200 Subject: Check before processing that credentials are valid --- tests/test_market.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/test_market.py b/tests/test_market.py index 2c92655..c89025b 100644 --- a/tests/test_market.py +++ b/tests/test_market.py @@ -887,6 +887,17 @@ class MarketTest(WebMockTestCase): store_report.assert_called_once() log_error.assert_not_called() + process.reset_mock() + log_error.reset_mock() + store_report.reset_mock() + with self.subTest(authentication_error=True): + m.ccxt.check_required_credentials.side_effect = market.ccxt.AuthenticationError + + m.process(["some_action"], before=True) + log_error.assert_called_with("market_authentication", message="Impossible to authenticate to market") + store_report.assert_called_once() + + m.ccxt.check_required_credentials.side_effect = True process.reset_mock() log_error.reset_mock() store_report.reset_mock() -- cgit v1.2.3