X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2Ftest_ccxt_wrapper.py;h=10e334daee0d102aa3997d46201da8c6ee9cc40d;hb=e8b0c21d62d72d955c21cb3047951433b1655745;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..10e334d 100644 --- a/tests/test_ccxt_wrapper.py +++ b/tests/test_ccxt_wrapper.py @@ -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): @@ -474,4 +478,8 @@ class poloniexETest(unittest.TestCase): create_order.assert_called_once_with("symbol", "type", "side", "amount", price="price", params="params") + def test_common_currency_code(self): + self.assertEqual("FOO", self.s.common_currency_code("FOO")) + def test_currency_id(self): + self.assertEqual("FOO", self.s.currency_id("FOO"))