diff options
Diffstat (limited to 'test_upscale_qt.py')
| -rw-r--r-- | test_upscale_qt.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test_upscale_qt.py b/test_upscale_qt.py index 526dc37..439807c 100644 --- a/test_upscale_qt.py +++ b/test_upscale_qt.py @@ -77,6 +77,25 @@ def test_save_over(): assert not os.path.exists(path + '.part') +from PyQt6.QtWidgets import QApplication # noqa: E402 + +APP = QApplication.instance() or QApplication([]) + + +def test_compare_view(): + before = QImage(10, 10, QImage.Format.Format_RGB32) + before.fill(QColor('red')) + after = QImage(40, 40, QImage.Format.Format_RGB32) + after.fill(QColor('blue')) + v = uq.CompareView() + v.resize(400, 400) # at or above the minimum size + v.set_images(before, after) + shot = v.grab().toImage() + # left of the divider shows before, right shows after + assert shot.pixelColor(100, 200) == QColor('red') + assert shot.pixelColor(300, 200) == QColor('blue') + + if __name__ == '__main__': for name, fn in list(globals().items()): if name.startswith('test_'): |
