Skip to content

Commit

Permalink
Test save_screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
drx committed Aug 27, 2017
1 parent 7e3df0e commit 814fb72
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/ristar/test_ristar.py
@@ -1,4 +1,5 @@
import hashlib
import os
import tempfile

from PySide.QtCore import Qt
Expand Down Expand Up @@ -37,6 +38,8 @@ def test_ristar(qtbot, mock):
- Select every zoom/render filter combo, run for 5 frames
and check if the video output (screenshot) is correct.
- Enable debug mode, press Start, check if the debug text is correct.
- Disable debug mode, take a screenshot and check if it was created.
"""
from kiwi import MainWindow, render_filters
window = MainWindow()
Expand Down Expand Up @@ -82,3 +85,13 @@ def test_ristar(qtbot, mock):
expected_debug_text = f.read()

assert debug_text == expected_debug_text

display.toggle_debug()

run_frames(display, 50)

filename = display.save_screenshot()

assert os.path.isfile(filename)
assert 'screenshot' in filename
assert filename.endswith('.png')

0 comments on commit 814fb72

Please sign in to comment.