]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git/blobdiff - tests/test_ccxt_wrapper.py
Acceptance test preparation
[perso/Immae/Projets/Cryptomonnaies/Cryptoportfolio/Trader.git] / tests / test_ccxt_wrapper.py
index d32469a83cee251933dc1176c75f84c1e1d9c812..597fe5c8d7f9b44c55ed9d85cfd68ec1b8ceb015 100644 (file)
@@ -22,11 +22,13 @@ class poloniexETest(unittest.TestCase):
             ccxt = market.ccxt.poloniexE()
             ccxt._market = mock.Mock
             ccxt._market.report = mock.Mock()
+            ccxt._market.market_id = 3
+            ccxt._market.user_id = 3
 
             ccxt.session.request("GET", "URL", data="data",
-                    headers="headers")
+                    headers={})
             ccxt._market.report.log_http_request.assert_called_with('GET', 'URL', 'data',
-                    'headers', 'response')
+                    {'X-market-id': '3', 'X-user-id': '3'}, 'response')
 
         with self.subTest("Raising"),\
                 mock.patch("market.ccxt.poloniexE.session") as session:
@@ -35,12 +37,14 @@ class poloniexETest(unittest.TestCase):
             ccxt = market.ccxt.poloniexE()
             ccxt._market = mock.Mock
             ccxt._market.report = mock.Mock()
+            ccxt._market.market_id = 3
+            ccxt._market.user_id = 3
 
             with self.assertRaises(market.ccxt.RequestException, msg="Boo") as cm:
                 ccxt.session.request("GET", "URL", data="data",
-                        headers="headers")
+                        headers={})
             ccxt._market.report.log_http_request.assert_called_with('GET', 'URL', 'data',
-                    'headers', cm.exception)
+                    {'X-market-id': '3', 'X-user-id': '3'}, cm.exception)
 
 
     def test_nanoseconds(self):