test of check_consistency added
This commit is contained in:
parent
664b96173e
commit
dcae3a2644
@ -61,7 +61,6 @@ class FreqtradeBot(object):
|
|||||||
self.exchange = Exchange(self.config)
|
self.exchange = Exchange(self.config)
|
||||||
self.wallets = Wallets(self.exchange)
|
self.wallets = Wallets(self.exchange)
|
||||||
|
|
||||||
|
|
||||||
# Initializing Edge only if enabled
|
# Initializing Edge only if enabled
|
||||||
self.edge = Edge(self.config, self.exchange, self.strategy) if \
|
self.edge = Edge(self.config, self.exchange, self.strategy) if \
|
||||||
self.config.get('edge', {}).get('enabled', False) else None
|
self.config.get('edge', {}).get('enabled', False) else None
|
||||||
@ -73,11 +72,11 @@ class FreqtradeBot(object):
|
|||||||
"""
|
"""
|
||||||
checks if config is compatible with the given strategy
|
checks if config is compatible with the given strategy
|
||||||
"""
|
"""
|
||||||
|
|
||||||
# Stoploss on exchange is only implemented for binance
|
# Stoploss on exchange is only implemented for binance
|
||||||
if strategy.stoploss_on_exchange and config.get('exchange') is not 'binance':
|
if strategy.stoploss_on_exchange and config.get('exchange') is not 'binance':
|
||||||
raise OperationalException(
|
raise OperationalException(
|
||||||
'On exchange stoploss is not supported for %s.' % config.get('exchange'))
|
'On exchange stoploss is not supported for %s.' % config['exchange']['name']
|
||||||
|
)
|
||||||
|
|
||||||
def _init_modules(self) -> None:
|
def _init_modules(self) -> None:
|
||||||
"""
|
"""
|
||||||
|
@ -1173,13 +1173,6 @@ def test_get_fee(default_conf, mocker):
|
|||||||
'get_fee', 'calculate_fee')
|
'get_fee', 'calculate_fee')
|
||||||
|
|
||||||
|
|
||||||
def test_stoploss_limit_available_only_for_binance(default_conf, mocker):
|
|
||||||
api_mock = MagicMock()
|
|
||||||
exchange = get_patched_exchange(mocker, default_conf, api_mock)
|
|
||||||
with pytest.raises(NotImplementedError):
|
|
||||||
exchange.stoploss_limit('BTC/ETH', 1, 0.8, 0.79)
|
|
||||||
|
|
||||||
|
|
||||||
def test_stoploss_limit_order(default_conf, mocker):
|
def test_stoploss_limit_order(default_conf, mocker):
|
||||||
api_mock = MagicMock()
|
api_mock = MagicMock()
|
||||||
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
|
order_id = 'test_prod_buy_{}'.format(randint(0, 10 ** 6))
|
||||||
|
@ -2516,3 +2516,9 @@ def test_startup_messages(default_conf, mocker):
|
|||||||
default_conf['dynamic_whitelist'] = 20
|
default_conf['dynamic_whitelist'] = 20
|
||||||
freqtrade = get_patched_freqtradebot(mocker, default_conf)
|
freqtrade = get_patched_freqtradebot(mocker, default_conf)
|
||||||
assert freqtrade.state is State.RUNNING
|
assert freqtrade.state is State.RUNNING
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_consistency(default_conf, mocker, caplog):
|
||||||
|
mocker.patch('freqtrade.freqtradebot.IStrategy.stoploss_on_exchange', True)
|
||||||
|
with pytest.raises(OperationalException):
|
||||||
|
FreqtradeBot(default_conf)
|
||||||
|
Loading…
Reference in New Issue
Block a user