added overwrite functionality

This commit is contained in:
Benoît Sierro
2023-08-09 11:30:30 +02:00
parent 7bb15871c3
commit ea8bc0360d
2 changed files with 22 additions and 1 deletions

View File

@@ -101,6 +101,21 @@ def test_clear(tmp_path: Path):
assert not zpath.exists()
def test_overwrite(tmp_path: Path):
params = Parameters(**PARAMS)
zpath = tmp_path / "file.zip"
_ = propagation(zpath, params)
orig_file = zpath.read_bytes()
with pytest.raises(FileExistsError):
_ = propagation(zpath, params)
_ = propagation(zpath, params, overwrite=True)
assert zpath.read_bytes() != orig_file
assert len(zpath.read_bytes()) == len(orig_file)
def test_zip_bundle(tmp_path: Path):
params = Parameters(**PARAMS)