summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJames R. Barlow <jim@purplerock.ca>2019-07-03 01:37:22 -0700
committerJames R. Barlow <jim@purplerock.ca>2019-07-03 01:37:22 -0700
commitd3b351bef4651cbb5d8f9c398cd90fd72f2131f8 (patch)
tree7ed7f9536740b01ac1dae47ea3a37408631ad085 /tests
parent715ad23be0ec167afc75381302b33ce1151d5da9 (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.py4
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):