diff options
author | James R. Barlow <jim@purplerock.ca> | 2019-07-03 01:37:22 -0700 |
---|---|---|
committer | James R. Barlow <jim@purplerock.ca> | 2019-07-03 01:37:22 -0700 |
commit | d3b351bef4651cbb5d8f9c398cd90fd72f2131f8 (patch) | |
tree | 7ed7f9536740b01ac1dae47ea3a37408631ad085 /tests | |
parent | 715ad23be0ec167afc75381302b33ce1151d5da9 (diff) |
Prevent saving file with same name as open file
To prevent clobbering lazy-loaded data.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_sanity.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/test_sanity.py b/tests/test_sanity.py index d0cd233..dcafb7c 100644 --- a/tests/test_sanity.py +++ b/tests/test_sanity.py @@ -133,7 +133,9 @@ def test_open_save(resources, outdir): out = str(outdir / 'graph.pdf') copy(str(resources / 'graph.pdf'), out) src = Pdf.open(out) - src.save(out) + with pytest.raises(ValueError): + src.save(out) + src.save(outdir / 'graph2.pdf') def test_readme_example(resources, outdir): |