Skip to content

Commit

Permalink
tests: add test comparing ods to png snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanVoxel committed Oct 13, 2024
1 parent 2edb11f commit 57d0a5a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Binary file added tagstudio/tests/fixtures/sample.ods
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions tagstudio/tests/qt/test_thumb_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@ def test_odt_preview(cwd, snapshot):
img.save(img_bytes, format="PNG")
img_bytes.seek(0)
assert img_bytes.read() == snapshot(extension_class=PNGImageSnapshotExtension)


def test_ods_preview(cwd, snapshot):
file_path: Path = cwd / "fixtures" / "sample.ods"
renderer = ThumbRenderer()
img: Image.Image = renderer._open_doc_thumb(file_path)

img_bytes = io.BytesIO()
img.save(img_bytes, format="PNG")
img_bytes.seek(0)
assert img_bytes.read() == snapshot(extension_class=PNGImageSnapshotExtension)

0 comments on commit 57d0a5a

Please sign in to comment.