Fix some windows tests

This commit is contained in:
Matthias 2024-06-08 17:41:05 +02:00
parent 36ad3bff62
commit 35700d1452
2 changed files with 4 additions and 4 deletions

View File

@ -509,7 +509,7 @@ def test_setup_configuration_with_arguments(mocker, default_conf, caplog, tmp_pa
assert "pair_whitelist" in config["exchange"] assert "pair_whitelist" in config["exchange"]
assert "datadir" in config assert "datadir" in config
assert log_has("Using data directory: {} ...".format("/foo/bar"), caplog) assert log_has("Using data directory: {} ...".format("/foo/bar"), caplog)
assert log_has(f"Using user-data directory: {tmp_path}/freqtrade ...", caplog) assert log_has(f"Using user-data directory: {tmp_path / 'freqtrade'} ...", caplog)
assert "user_data_dir" in config assert "user_data_dir" in config
assert "timeframe" in config assert "timeframe" in config

View File

@ -28,10 +28,10 @@ def test_create_userdata_dir(mocker, tmp_path, caplog) -> None:
mocker.patch.object(Path, "is_dir", MagicMock(return_value=False)) mocker.patch.object(Path, "is_dir", MagicMock(return_value=False))
md = mocker.patch.object(Path, "mkdir", MagicMock()) md = mocker.patch.object(Path, "mkdir", MagicMock())
x = create_userdata_dir(f"{tmp_path}/bar", create_dir=True) x = create_userdata_dir(tmp_path / "bar", create_dir=True)
assert md.call_count == 10 assert md.call_count == 10
assert md.call_args[1]["parents"] is False assert md.call_args[1]["parents"] is False
assert log_has(f'Created user-data directory: {f"{tmp_path}/bar"}', caplog) assert log_has(f'Created user-data directory: {tmp_path / "bar"}', caplog)
assert isinstance(x, Path) assert isinstance(x, Path)
assert str(x) == f"{tmp_path}/bar" assert str(x) == f"{tmp_path}/bar"
@ -78,7 +78,7 @@ def test_copy_sample_files(mocker, tmp_path) -> None:
copy_sample_files(Path(f"{tmp_path}/bar")) copy_sample_files(Path(f"{tmp_path}/bar"))
assert copymock.call_count == 3 assert copymock.call_count == 3
assert copymock.call_args_list[0][0][1] == str(f"{tmp_path}/bar/strategies/sample_strategy.py") assert copymock.call_args_list[0][0][1] == str(tmp_path / "bar/strategies/sample_strategy.py")
assert copymock.call_args_list[1][0][1] == str( assert copymock.call_args_list[1][0][1] == str(
f"{tmp_path}/bar/hyperopts/sample_hyperopt_loss.py" f"{tmp_path}/bar/hyperopts/sample_hyperopt_loss.py"
) )