fix variable names to pythonic

This commit is contained in:
Janne Sinivirta 2018-01-06 21:21:56 +02:00
parent 6ab0ec6aac
commit a29f3de025
1 changed files with 10 additions and 10 deletions

View File

@ -331,7 +331,7 @@ def test_check_handle_timedout_buy(default_conf, ticker, health, limit_buy_order
cancel_order=cancel_order_mock)
init(default_conf, create_engine('sqlite://'))
tradeBuy = Trade(
trade_buy = Trade(
pair='BTC_ETH',
open_rate=0.00001099,
exchange='BITTREX',
@ -343,12 +343,12 @@ def test_check_handle_timedout_buy(default_conf, ticker, health, limit_buy_order
is_open=True
)
Trade.session.add(tradeBuy)
Trade.session.add(trade_buy)
# check it does cancel buy orders over the time limit
check_handle_timedout(600)
assert cancel_order_mock.call_count == 1
trades = Trade.query.filter(Trade.open_order_id.is_(tradeBuy.open_order_id)).all()
trades = Trade.query.filter(Trade.open_order_id.is_(trade_buy.open_order_id)).all()
assert len(trades) == 0
@ -363,7 +363,7 @@ def test_check_handle_timedout_sell(default_conf, ticker, health, limit_sell_ord
cancel_order=cancel_order_mock)
init(default_conf, create_engine('sqlite://'))
tradeSell = Trade(
trade_sell = Trade(
pair='BTC_ETH',
open_rate=0.00001099,
exchange='BITTREX',
@ -376,12 +376,12 @@ def test_check_handle_timedout_sell(default_conf, ticker, health, limit_sell_ord
is_open=False
)
Trade.session.add(tradeSell)
Trade.session.add(trade_sell)
# check it does cancel sell orders over the time limit
check_handle_timedout(600)
assert cancel_order_mock.call_count == 1
assert tradeSell.is_open is True
assert trade_sell.is_open is True
def test_check_handle_timedout_partial(default_conf, ticker, limit_buy_order_old_partial,
@ -396,7 +396,7 @@ def test_check_handle_timedout_partial(default_conf, ticker, limit_buy_order_old
cancel_order=cancel_order_mock)
init(default_conf, create_engine('sqlite://'))
tradeBuy = Trade(
trade_buy = Trade(
pair='BTC_ETH',
open_rate=0.00001099,
exchange='BITTREX',
@ -408,16 +408,16 @@ def test_check_handle_timedout_partial(default_conf, ticker, limit_buy_order_old
is_open=True
)
Trade.session.add(tradeBuy)
Trade.session.add(trade_buy)
# check it does cancel buy orders over the time limit
# note this is for a partially-complete buy order
check_handle_timedout(600)
assert cancel_order_mock.call_count == 1
trades = Trade.query.filter(Trade.open_order_id.is_(tradeBuy.open_order_id)).all()
trades = Trade.query.filter(Trade.open_order_id.is_(trade_buy.open_order_id)).all()
assert len(trades) == 1
assert trades[0].amount == 23.0
assert trades[0].stake_amount == tradeBuy.open_rate * trades[0].amount
assert trades[0].stake_amount == trade_buy.open_rate * trades[0].amount
def test_balance_fully_ask_side(mocker):