simplify unnecessary == True and == False assertions
This commit is contained in:
parent
5551c9ec3b
commit
5537f0bf5b
@ -40,8 +40,8 @@ def test_populates_buy_trend(result):
|
|||||||
def test_returns_latest_buy_signal(mocker):
|
def test_returns_latest_buy_signal(mocker):
|
||||||
buydf = DataFrame([{'buy': 1, 'date': arrow.utcnow()}])
|
buydf = DataFrame([{'buy': 1, 'date': arrow.utcnow()}])
|
||||||
mocker.patch('freqtrade.analyze.analyze_ticker', return_value=buydf)
|
mocker.patch('freqtrade.analyze.analyze_ticker', return_value=buydf)
|
||||||
assert get_buy_signal('BTC-ETH') == True
|
assert get_buy_signal('BTC-ETH')
|
||||||
|
|
||||||
buydf = DataFrame([{'buy': 0, 'date': arrow.utcnow()}])
|
buydf = DataFrame([{'buy': 0, 'date': arrow.utcnow()}])
|
||||||
mocker.patch('freqtrade.analyze.analyze_ticker', return_value=buydf)
|
mocker.patch('freqtrade.analyze.analyze_ticker', return_value=buydf)
|
||||||
assert get_buy_signal('BTC-ETH') == False
|
assert not get_buy_signal('BTC-ETH')
|
||||||
|
@ -72,7 +72,7 @@ def test_create_trade(conf, mocker):
|
|||||||
assert trade.exchange == exchange.Exchange.BITTREX
|
assert trade.exchange == exchange.Exchange.BITTREX
|
||||||
assert trade.amount == 206.43811673387373
|
assert trade.amount == 206.43811673387373
|
||||||
assert trade.stake_amount == 15.0
|
assert trade.stake_amount == 15.0
|
||||||
assert trade.is_open == True
|
assert trade.is_open
|
||||||
assert trade.open_date is not None
|
assert trade.open_date is not None
|
||||||
assert whitelist == conf['bittrex']['pair_whitelist']
|
assert whitelist == conf['bittrex']['pair_whitelist']
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ def test_close_trade(conf, mocker):
|
|||||||
|
|
||||||
closed = close_trade_if_fulfilled(trade)
|
closed = close_trade_if_fulfilled(trade)
|
||||||
assert closed
|
assert closed
|
||||||
assert trade.is_open == False
|
assert not trade.is_open
|
||||||
|
|
||||||
def test_balance_fully_ask_side(mocker):
|
def test_balance_fully_ask_side(mocker):
|
||||||
mocker.patch.dict('freqtrade.main._CONF', {'bid_strategy': {'ask_last_balance': 0.0}})
|
mocker.patch.dict('freqtrade.main._CONF', {'bid_strategy': {'ask_last_balance': 0.0}})
|
||||||
|
Loading…
Reference in New Issue
Block a user