added tests for bot_start
This commit is contained in:
parent
e76c6e8ad3
commit
810e190e16
@ -312,6 +312,7 @@ def test_backtesting_init(mocker, default_conf, order_types) -> None:
|
|||||||
get_fee.assert_called()
|
get_fee.assert_called()
|
||||||
assert backtesting.fee == 0.5
|
assert backtesting.fee == 0.5
|
||||||
assert not backtesting.strategy.order_types["stoploss_on_exchange"]
|
assert not backtesting.strategy.order_types["stoploss_on_exchange"]
|
||||||
|
assert backtesting.strategy.bot_started is True
|
||||||
|
|
||||||
|
|
||||||
def test_backtesting_init_no_timeframe(mocker, default_conf, caplog) -> None:
|
def test_backtesting_init_no_timeframe(mocker, default_conf, caplog) -> None:
|
||||||
|
@ -94,6 +94,7 @@ def test_edge_init(mocker, edge_conf) -> None:
|
|||||||
assert edge_cli.config == edge_conf
|
assert edge_cli.config == edge_conf
|
||||||
assert edge_cli.config['stake_amount'] == 'unlimited'
|
assert edge_cli.config['stake_amount'] == 'unlimited'
|
||||||
assert callable(edge_cli.edge.calculate)
|
assert callable(edge_cli.edge.calculate)
|
||||||
|
assert edge_conf['strategy'].bot_started is True
|
||||||
|
|
||||||
|
|
||||||
def test_edge_init_fee(mocker, edge_conf) -> None:
|
def test_edge_init_fee(mocker, edge_conf) -> None:
|
||||||
|
@ -82,6 +82,11 @@ class StrategyTestV3(IStrategy):
|
|||||||
# })
|
# })
|
||||||
# return prot
|
# return prot
|
||||||
|
|
||||||
|
bot_started = False
|
||||||
|
|
||||||
|
def bot_start(self):
|
||||||
|
self.bot_started = True
|
||||||
|
|
||||||
def informative_pairs(self):
|
def informative_pairs(self):
|
||||||
|
|
||||||
return []
|
return []
|
||||||
|
@ -32,6 +32,7 @@ def test_strategy_test_v3(result, fee, is_short, side):
|
|||||||
assert type(indicators) is DataFrame
|
assert type(indicators) is DataFrame
|
||||||
assert type(strategy.populate_buy_trend(indicators, metadata)) is DataFrame
|
assert type(strategy.populate_buy_trend(indicators, metadata)) is DataFrame
|
||||||
assert type(strategy.populate_sell_trend(indicators, metadata)) is DataFrame
|
assert type(strategy.populate_sell_trend(indicators, metadata)) is DataFrame
|
||||||
|
assert strategy.bot_started is True
|
||||||
|
|
||||||
trade = Trade(
|
trade = Trade(
|
||||||
open_rate=19_000,
|
open_rate=19_000,
|
||||||
|
@ -58,6 +58,7 @@ def test_init_plotscript(default_conf, mocker, testdatadir):
|
|||||||
assert "ohlcv" in ret
|
assert "ohlcv" in ret
|
||||||
assert "TRX/BTC" in ret["ohlcv"]
|
assert "TRX/BTC" in ret["ohlcv"]
|
||||||
assert "ADA/BTC" in ret["ohlcv"]
|
assert "ADA/BTC" in ret["ohlcv"]
|
||||||
|
assert default_conf['strategy'].bot_started is True
|
||||||
|
|
||||||
|
|
||||||
def test_add_indicators(default_conf, testdatadir, caplog):
|
def test_add_indicators(default_conf, testdatadir, caplog):
|
||||||
|
Loading…
Reference in New Issue
Block a user