|
@@ 230-243 (lines=14) @@
|
| 227 |
|
self.assertEqual(history[0].url, base_url + url_args) |
| 228 |
|
self.assertTrue(mock_logger.debug.called) |
| 229 |
|
|
| 230 |
|
def test_showMyTrades_with_params(self, mock_logger, m): |
| 231 |
|
'''Test function showMyTrades with parameters.''' |
| 232 |
|
params = {'type': 'buy', |
| 233 |
|
'trading_pair': 'btceur'} |
| 234 |
|
base_url = 'https://api.bitcoin.de/v2/trades' |
| 235 |
|
url_args = '?' + urlencode(params) |
| 236 |
|
response = self.sampleData('showMyTrades') |
| 237 |
|
m.get(requests_mock.ANY, json=response, status_code=200) |
| 238 |
|
self.conn.showMyTrades(type=params.get('type'), |
| 239 |
|
trading_pair=params.get('trading_pair')) |
| 240 |
|
history = m.request_history |
| 241 |
|
self.assertEqual(history[0].method, "GET") |
| 242 |
|
self.assertEqual(history[0].url, base_url + url_args) |
| 243 |
|
self.assertTrue(mock_logger.debug.called) |
| 244 |
|
|
| 245 |
|
def test_showMyTradeDetails(self, mock_logger, m): |
| 246 |
|
'''Test function showMyTradeDetails.''' |
|
@@ 168-181 (lines=14) @@
|
| 165 |
|
self.assertEqual(history[0].url, base_url + url_args) |
| 166 |
|
self.assertTrue(mock_logger.debug.called) |
| 167 |
|
|
| 168 |
|
def test_showMyOrders(self, mock_logger, m): |
| 169 |
|
'''Test function showMyOrders.''' |
| 170 |
|
params = {'type': 'buy', |
| 171 |
|
'trading_pair': 'btceur'} |
| 172 |
|
base_url = 'https://api.bitcoin.de/v2/orders/my_own' |
| 173 |
|
url_args = '?' + urlencode(params) |
| 174 |
|
response = self.sampleData('showMyOrders') |
| 175 |
|
m.get(requests_mock.ANY, json=response, status_code=200) |
| 176 |
|
self.conn.showMyOrders(type=params.get('type'), |
| 177 |
|
trading_pair=params.get('trading_pair')) |
| 178 |
|
history = m.request_history |
| 179 |
|
self.assertEqual(history[0].method, "GET") |
| 180 |
|
self.assertEqual(history[0].url, base_url + url_args) |
| 181 |
|
self.assertTrue(mock_logger.debug.called) |
| 182 |
|
|
| 183 |
|
def test_showMyOrderDetails(self, mock_logger, m): |
| 184 |
|
'''Test function showMyOrderDetails.''' |