Add better test scenario

This commit is contained in:
Matthias 2022-05-10 19:17:12 +02:00
parent 31cce741ac
commit 044afdf7af
3 changed files with 9 additions and 3 deletions

View File

@ -150,7 +150,6 @@ class Configuration:
self._args_to_config(config, argname='db_url_from',
logstring='Parameter --db-url-from detected ...')
if config.get('force_entry_enable', False):
logger.warning('`force_entry_enable` RPC message enabled.')

View File

@ -1,5 +1,6 @@
import json
import re
from datetime import datetime
from io import BytesIO
from pathlib import Path
from unittest.mock import MagicMock, PropertyMock
@ -21,6 +22,7 @@ from freqtrade.configuration import setup_utils_configuration
from freqtrade.enums import RunMode
from freqtrade.exceptions import OperationalException
from freqtrade.persistence.models import init_db
from freqtrade.persistence.pairlock_middleware import PairLocks
from tests.conftest import (CURRENT_TEST_STRATEGY, create_mock_trades, get_args, log_has,
log_has_re, patch_exchange, patched_configuration_load_config_file)
from tests.conftest_trades import MOCK_TRADE_COUNT
@ -1479,9 +1481,14 @@ def test_start_convert_db(mocker, fee, tmpdir, caplog):
init_db(db_from, False)
create_mock_trades(fee)
PairLocks.timeframe = '5m'
PairLocks.lock_pair('XRP/USDT', datetime.now(), 'Random reason 125', side='long')
assert db_src_file.is_file()
assert not db_target_file.is_file()
pargs = get_args(args)
pargs['config'] = None
start_convert_db(pargs)
assert db_target_file.is_file()

View File

@ -1416,14 +1416,14 @@ def test_migrate_set_sequence_ids():
engine = MagicMock()
engine.begin = MagicMock()
engine.name = 'postgresql'
set_sequence_ids(engine, 22, 55)
set_sequence_ids(engine, 22, 55, 5)
assert engine.begin.call_count == 1
engine.reset_mock()
engine.begin.reset_mock()
engine.name = 'somethingelse'
set_sequence_ids(engine, 22, 55)
set_sequence_ids(engine, 22, 55, 6)
assert engine.begin.call_count == 0