aboutsummaryrefslogtreecommitdiff
path: root/tests/test_ccxt_wrapper.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_ccxt_wrapper.py')
-rw-r--r--tests/test_ccxt_wrapper.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/test_ccxt_wrapper.py b/tests/test_ccxt_wrapper.py
index d32469a..597fe5c 100644
--- a/tests/test_ccxt_wrapper.py
+++ b/tests/test_ccxt_wrapper.py
@@ -22,11 +22,13 @@ class poloniexETest(unittest.TestCase):
22 ccxt = market.ccxt.poloniexE() 22 ccxt = market.ccxt.poloniexE()
23 ccxt._market = mock.Mock 23 ccxt._market = mock.Mock
24 ccxt._market.report = mock.Mock() 24 ccxt._market.report = mock.Mock()
25 ccxt._market.market_id = 3
26 ccxt._market.user_id = 3
25 27
26 ccxt.session.request("GET", "URL", data="data", 28 ccxt.session.request("GET", "URL", data="data",
27 headers="headers") 29 headers={})
28 ccxt._market.report.log_http_request.assert_called_with('GET', 'URL', 'data', 30 ccxt._market.report.log_http_request.assert_called_with('GET', 'URL', 'data',
29 'headers', 'response') 31 {'X-market-id': '3', 'X-user-id': '3'}, 'response')
30 32
31 with self.subTest("Raising"),\ 33 with self.subTest("Raising"),\
32 mock.patch("market.ccxt.poloniexE.session") as session: 34 mock.patch("market.ccxt.poloniexE.session") as session:
@@ -35,12 +37,14 @@ class poloniexETest(unittest.TestCase):
35 ccxt = market.ccxt.poloniexE() 37 ccxt = market.ccxt.poloniexE()
36 ccxt._market = mock.Mock 38 ccxt._market = mock.Mock
37 ccxt._market.report = mock.Mock() 39 ccxt._market.report = mock.Mock()
40 ccxt._market.market_id = 3
41 ccxt._market.user_id = 3
38 42
39 with self.assertRaises(market.ccxt.RequestException, msg="Boo") as cm: 43 with self.assertRaises(market.ccxt.RequestException, msg="Boo") as cm:
40 ccxt.session.request("GET", "URL", data="data", 44 ccxt.session.request("GET", "URL", data="data",
41 headers="headers") 45 headers={})
42 ccxt._market.report.log_http_request.assert_called_with('GET', 'URL', 'data', 46 ccxt._market.report.log_http_request.assert_called_with('GET', 'URL', 'data',
43 'headers', cm.exception) 47 {'X-market-id': '3', 'X-user-id': '3'}, cm.exception)
44 48
45 49
46 def test_nanoseconds(self): 50 def test_nanoseconds(self):