Fix tests after changing dry_run_wallet amount

This commit is contained in:
Matthias 2019-12-15 09:37:08 +01:00
parent 931d24b5a8
commit 52b212db64
3 changed files with 7 additions and 3 deletions

View File

@ -876,6 +876,7 @@ def test_sell_considers_time_in_force(default_conf, mocker, exchange_name):
def test_get_balance_dry_run(default_conf, mocker): def test_get_balance_dry_run(default_conf, mocker):
default_conf['dry_run'] = True default_conf['dry_run'] = True
default_conf['dry_run_wallet'] = 999.9
exchange = get_patched_exchange(mocker, default_conf) exchange = get_patched_exchange(mocker, default_conf)
assert exchange.get_balance(currency='BTC') == 999.9 assert exchange.get_balance(currency='BTC') == 999.9

View File

@ -8,9 +8,9 @@ from pathlib import Path
from unittest.mock import MagicMock from unittest.mock import MagicMock
import pytest import pytest
from jsonschema import Draft4Validator, ValidationError, validate from jsonschema import ValidationError
from freqtrade import OperationalException, constants from freqtrade import OperationalException
from freqtrade.configuration import (Arguments, Configuration, check_exchange, from freqtrade.configuration import (Arguments, Configuration, check_exchange,
remove_credentials, remove_credentials,
validate_config_consistency) validate_config_consistency)
@ -718,7 +718,8 @@ def test_load_config_warn_forcebuy(default_conf, mocker, caplog) -> None:
def test_validate_default_conf(default_conf) -> None: def test_validate_default_conf(default_conf) -> None:
validate(default_conf, constants.CONF_SCHEMA, Draft4Validator) # Validate via our validator - we allow setting defaults!
validate_config_schema(default_conf)
def test_validate_tsl(default_conf): def test_validate_tsl(default_conf):

View File

@ -211,6 +211,7 @@ def test_edge_overrides_stake_amount(mocker, edge_conf) -> None:
patch_RPCManager(mocker) patch_RPCManager(mocker)
patch_exchange(mocker) patch_exchange(mocker)
patch_edge(mocker) patch_edge(mocker)
edge_conf['dry_run_wallet'] = 999.9
freqtrade = FreqtradeBot(edge_conf) freqtrade = FreqtradeBot(edge_conf)
assert freqtrade._get_trade_stake_amount('NEO/BTC') == (999.9 * 0.5 * 0.01) / 0.20 assert freqtrade._get_trade_stake_amount('NEO/BTC') == (999.9 * 0.5 * 0.01) / 0.20
@ -1338,6 +1339,7 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee, caplog,
patch_exchange(mocker) patch_exchange(mocker)
patch_edge(mocker) patch_edge(mocker)
edge_conf['max_open_trades'] = float('inf') edge_conf['max_open_trades'] = float('inf')
edge_conf['dry_run_wallet'] = 999.9
mocker.patch.multiple( mocker.patch.multiple(
'freqtrade.exchange.Exchange', 'freqtrade.exchange.Exchange',
get_ticker=MagicMock(return_value={ get_ticker=MagicMock(return_value={