X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Ftest_ccxt_wrapper.py;h=f07674e7927e130ce94efb680c2420243cf56c65;hb=1d72880c097ea8259ce9cc63cfe55e6cc7516bd2;hp=d32469a83cee251933dc1176c75f84c1e1d9c812;hpb=c682bdf4a02a45312ef1aadf8aa26136cf308414;p=perso%2FImmae%2FProjets%2FCryptomonnaies%2FCryptoportfolio%2FTrader.git diff --git a/tests/test_ccxt_wrapper.py b/tests/test_ccxt_wrapper.py index d32469a..f07674e 100644 --- a/tests/test_ccxt_wrapper.py +++ b/tests/test_ccxt_wrapper.py @@ -1,8 +1,7 @@ -from .helper import limits, unittest, mock, D +from .helper import unittest, mock, D import requests_mock import market -@unittest.skipUnless("unit" in limits, "Unit skipped") class poloniexETest(unittest.TestCase): def setUp(self): super().setUp() @@ -22,11 +21,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 +36,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):