aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-08 21:00:27 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2018-05-08 21:00:27 +0200
commit5321200c05b3b693581ec4238c74eb02e0b715d7 (patch)
tree893f0bd619deba53cd92895c97bd13e0a600feb9 /tests
parent3a15ffc79ea84e5ec6200545bcbf11fc6c1c6564 (diff)
downloadTrader-5321200c05b3b693581ec4238c74eb02e0b715d7.tar.gz
Trader-5321200c05b3b693581ec4238c74eb02e0b715d7.tar.zst
Trader-5321200c05b3b693581ec4238c74eb02e0b715d7.zip
Check before processing that credentials are valid
Diffstat (limited to 'tests')
-rw-r--r--tests/test_market.py11
1 files changed, 11 insertions, 0 deletions
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
@@ -890,6 +890,17 @@ class MarketTest(WebMockTestCase):
890 process.reset_mock() 890 process.reset_mock()
891 log_error.reset_mock() 891 log_error.reset_mock()
892 store_report.reset_mock() 892 store_report.reset_mock()
893 with self.subTest(authentication_error=True):
894 m.ccxt.check_required_credentials.side_effect = market.ccxt.AuthenticationError
895
896 m.process(["some_action"], before=True)
897 log_error.assert_called_with("market_authentication", message="Impossible to authenticate to market")
898 store_report.assert_called_once()
899
900 m.ccxt.check_required_credentials.side_effect = True
901 process.reset_mock()
902 log_error.reset_mock()
903 store_report.reset_mock()
893 with self.subTest(unhandled_exception=True): 904 with self.subTest(unhandled_exception=True):
894 process.side_effect = Exception("bouh") 905 process.side_effect = Exception("bouh")
895 906