Browse Source

Added fill_mock_backup_dir to create a suitable testing

environment.
master
Raphael Roberts 5 years ago
parent
commit
6cc6ef0a1c
  1. 15
      tests/fixtures/mock_backupdir.py

15
tests/fixtures/mock_backupdir.py

@ -0,0 +1,15 @@
import pytest
import shutil
from pathlib import Path
def fill_mock_backup_dir(rootdir: Path, target_dir: Path):
for property_file in rootdir.glob("*.properties"):
shutil.copy2(property_file, target_dir / property_file.name)
for other_file in filter(
lambda path: path.suffix != ".properties", rootdir.glob("*")
):
dest = target_dir / other_file.name
dest.touch(exist_ok=True)
Loading…
Cancel
Save