Skip to content

Commit c655e77

Browse files
committed
Check that save actually saved a file
1 parent 1264f61 commit c655e77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/astro_image_display_api/widget_api_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
from astropy import units as u # noqa: E402
1313
from astropy.wcs import WCS # noqa: E402
1414

15+
__all__ = ['ImageWidgetAPITest']
16+
1517

1618
class ImageWidgetAPITest:
1719
cursor_error_classes = (ValueError)
@@ -403,12 +405,14 @@ def test_scroll_pan(self):
403405
def test_save(self, tmp_path):
404406
filename = tmp_path / 'woot.png'
405407
self.image.save(filename)
408+
assert filename.is_file()
406409

407410
def test_save_overwrite(self, tmp_path):
408411
filename = tmp_path / 'woot.png'
409412

410413
# First write should be fine
411414
self.image.save(filename)
415+
assert filename.is_file()
412416

413417
# Second write should raise an error because file exists
414418
with pytest.raises(FileExistsError):

0 commit comments

Comments
 (0)