Skip to content

Commit

Permalink
Add test for export to jpg image
Browse files Browse the repository at this point in the history
  • Loading branch information
kbengs committed Jan 18, 2025
1 parent 32cb9a9 commit a302c0e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1084,3 +1084,33 @@ def test_02_print_all_to_pdf(self):

def test_03_quit(self):
self._quit_without_saving()


class TestBatch13(PdfArrangerTest):
"""Test export as jpg images"""

def test_01_import_pdf(self):
self._start(["tests/test.pdf"])

def test_02_export_as_png(self):
"""Export image at default 150 DPI"""
self._popupmenu(None, ["Select", "Select All"])
self._mainmenu(["Export", "Export Selection to JPG Images…"])
self._save_as_chooser("image-001.jpg")

def test_03_import_png(self):
"""Import the two images that were created"""
tmp = self.__class__.tmp
filename = os.path.join(tmp, "image-001.jpg")
filechooser = self._import_file(filename)
self._wait_cond(lambda: filechooser.dead)
filename = os.path.join(tmp, "image-002.jpg")
filechooser = self._import_file(filename)
self._wait_cond(lambda: filechooser.dead)
self.assertEqual(len(self._icons()), 4)
self._app().child(roleName="layered pane").grabFocus()
self._app().keyCombo("End")
self._assert_page_size(215.9, 279.4)

def test_04_quit(self):
self._quit_without_saving()

0 comments on commit a302c0e

Please sign in to comment.