added overwrite functionality
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user