Fix PEP8 errors
This commit is contained in:
parent
3c60b33793
commit
10dbf468c4
@ -227,7 +227,7 @@ def test_cancel_order_dry_run(default_conf, mocker):
|
||||
default_conf['dry_run'] = True
|
||||
mocker.patch.dict('freqtrade.exchange._CONF', default_conf)
|
||||
|
||||
assert cancel_order(order_id='123',pair='ABC_XYZ') is None
|
||||
assert cancel_order(order_id='123', pair='ABC_XYZ') is None
|
||||
|
||||
|
||||
# Ensure that if not dry_run, we should call API
|
||||
@ -237,7 +237,7 @@ def test_cancel_order(default_conf, mocker):
|
||||
api_mock = MagicMock()
|
||||
api_mock.cancel_order = MagicMock(return_value=123)
|
||||
mocker.patch('freqtrade.exchange._API', api_mock)
|
||||
assert cancel_order(order_id='_',pair='ABC_XYZ') == 123
|
||||
assert cancel_order(order_id='_', pair='ABC_XYZ') == 123
|
||||
|
||||
|
||||
def test_get_order(default_conf, mocker):
|
||||
@ -247,9 +247,9 @@ def test_get_order(default_conf, mocker):
|
||||
order.myid = 123
|
||||
order.pair = 'ABC_XYZ'
|
||||
exchange._DRY_RUN_OPEN_ORDERS['X'] = order
|
||||
print(exchange.get_order('X','ABC_XYZ'))
|
||||
assert exchange.get_order('X','ABC_XYZ').myid == 123
|
||||
assert exchange.get_order('X','ABC_XYZ').pair == 'ABC_XYZ'
|
||||
print(exchange.get_order('X', 'ABC_XYZ'))
|
||||
assert exchange.get_order('X', 'ABC_XYZ').myid == 123
|
||||
assert exchange.get_order('X', 'ABC_XYZ').pair == 'ABC_XYZ'
|
||||
|
||||
default_conf['dry_run'] = False
|
||||
mocker.patch.dict('freqtrade.exchange._CONF', default_conf)
|
||||
|
@ -264,27 +264,27 @@ def test_exchange_bittrex_get_ticker_history():
|
||||
def test_exchange_bittrex_get_order():
|
||||
wb = make_wrap_bittrex()
|
||||
fb = FakeBittrex()
|
||||
order = wb.get_order('someUUID','somePAIR')
|
||||
order = wb.get_order('someUUID', 'somePAIR')
|
||||
assert order['id'] == 'ABC123'
|
||||
fb.success = False
|
||||
with pytest.raises(btx.OperationalException, match=r'lost'):
|
||||
wb.get_order('someUUID','somePAIR')
|
||||
wb.get_order('someUUID', 'somePAIR')
|
||||
|
||||
|
||||
def test_exchange_bittrex_cancel_order():
|
||||
wb = make_wrap_bittrex()
|
||||
fb = FakeBittrex()
|
||||
wb.cancel_order('someUUID','somePAIR')
|
||||
wb.cancel_order('someUUID', 'somePAIR')
|
||||
with pytest.raises(btx.OperationalException, match=r'no such order'):
|
||||
fb.success = False
|
||||
wb.cancel_order('someUUID','somePAIR')
|
||||
wb.cancel_order('someUUID', 'somePAIR')
|
||||
# Note: this can be a bug in exchange.bittrex._validate_response
|
||||
with pytest.raises(KeyError):
|
||||
fb.result = {'success': False} # message is missing!
|
||||
wb.cancel_order('someUUID','somePAIR')
|
||||
wb.cancel_order('someUUID', 'somePAIR')
|
||||
with pytest.raises(btx.OperationalException, match=r'foo'):
|
||||
fb.result = {'success': False, 'message': 'foo'}
|
||||
wb.cancel_order('someUUID','somePAIR')
|
||||
wb.cancel_order('someUUID', 'somePAIR')
|
||||
|
||||
|
||||
def test_exchange_get_pair_detail_url():
|
||||
|
Loading…
Reference in New Issue
Block a user