-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()
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:
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):