Don't overwrite files

This commit is contained in:
Matthias
2020-02-01 14:12:21 +01:00
parent c224c66978
commit cfa6a3e3d3
2 changed files with 17 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import pytest
from freqtrade.commands.build_config_commands import (ask_user_config,
start_new_config)
from freqtrade.exceptions import OperationalException
from tests.conftest import get_args, log_has_re
@@ -43,6 +44,17 @@ def test_start_new_config(mocker, caplog, exchange):
assert result['ticker_interval'] == '15m'
def test_start_new_config_exists(mocker, caplog):
mocker.patch.object(Path, "exists", MagicMock(return_value=True))
args = [
"new-config",
"--config",
"coolconfig.json"
]
with pytest.raises(OperationalException, match=r"Configuration .* already exists\."):
start_new_config(get_args(args))
def test_ask_user_config():
# TODO: Implement me
pass