Fix tests (both tests where testing the same thing)
This commit is contained in:
parent
3c399fbe3f
commit
1a5b0969b9
@ -570,7 +570,8 @@ def test_create_trade_limit_reached(default_conf, ticker, limit_buy_order,
|
|||||||
assert freqtrade._get_trade_stake_amount('ETH/BTC') is None
|
assert freqtrade._get_trade_stake_amount('ETH/BTC') is None
|
||||||
|
|
||||||
|
|
||||||
def test_create_trade_no_pairs(default_conf, ticker, limit_buy_order, fee, markets, mocker) -> None:
|
def test_create_trade_no_pairs_let(default_conf, ticker, limit_buy_order, fee,
|
||||||
|
markets, mocker, caplog) -> None:
|
||||||
patch_RPCManager(mocker)
|
patch_RPCManager(mocker)
|
||||||
patch_exchange(mocker)
|
patch_exchange(mocker)
|
||||||
mocker.patch.multiple(
|
mocker.patch.multiple(
|
||||||
@ -582,16 +583,17 @@ def test_create_trade_no_pairs(default_conf, ticker, limit_buy_order, fee, marke
|
|||||||
)
|
)
|
||||||
|
|
||||||
default_conf['exchange']['pair_whitelist'] = ["ETH/BTC"]
|
default_conf['exchange']['pair_whitelist'] = ["ETH/BTC"]
|
||||||
default_conf['exchange']['pair_blacklist'] = ["ETH/BTC"]
|
|
||||||
freqtrade = FreqtradeBot(default_conf)
|
freqtrade = FreqtradeBot(default_conf)
|
||||||
patch_get_signal(freqtrade)
|
patch_get_signal(freqtrade)
|
||||||
|
|
||||||
freqtrade.create_trade()
|
assert freqtrade.create_trade()
|
||||||
assert not freqtrade.create_trade()
|
assert not freqtrade.create_trade()
|
||||||
|
assert log_has("No currency pair in whitelist, but checking to sell open trades.",
|
||||||
|
caplog.record_tuples)
|
||||||
|
|
||||||
|
|
||||||
def test_create_trade_no_pairs_after_blacklist(default_conf, ticker,
|
def test_create_trade_no_pairs_in_whitelist(default_conf, ticker, limit_buy_order, fee,
|
||||||
limit_buy_order, fee, markets, mocker) -> None:
|
markets, mocker, caplog) -> None:
|
||||||
patch_RPCManager(mocker)
|
patch_RPCManager(mocker)
|
||||||
patch_exchange(mocker)
|
patch_exchange(mocker)
|
||||||
mocker.patch.multiple(
|
mocker.patch.multiple(
|
||||||
@ -601,13 +603,12 @@ def test_create_trade_no_pairs_after_blacklist(default_conf, ticker,
|
|||||||
get_fee=fee,
|
get_fee=fee,
|
||||||
markets=PropertyMock(return_value=markets)
|
markets=PropertyMock(return_value=markets)
|
||||||
)
|
)
|
||||||
default_conf['exchange']['pair_whitelist'] = ["ETH/BTC"]
|
default_conf['exchange']['pair_whitelist'] = []
|
||||||
default_conf['exchange']['pair_blacklist'] = ["ETH/BTC"]
|
|
||||||
freqtrade = FreqtradeBot(default_conf)
|
freqtrade = FreqtradeBot(default_conf)
|
||||||
patch_get_signal(freqtrade)
|
patch_get_signal(freqtrade)
|
||||||
|
|
||||||
freqtrade.create_trade()
|
|
||||||
assert not freqtrade.create_trade()
|
assert not freqtrade.create_trade()
|
||||||
|
assert log_has("Whitelist is empty.", caplog.record_tuples)
|
||||||
|
|
||||||
|
|
||||||
def test_create_trade_no_signal(default_conf, fee, mocker) -> None:
|
def test_create_trade_no_signal(default_conf, fee, mocker) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user