diff options
Diffstat (limited to 'test_upscale_qt.py')
| -rw-r--r-- | test_upscale_qt.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test_upscale_qt.py b/test_upscale_qt.py index 439807c..1fbfe2c 100644 --- a/test_upscale_qt.py +++ b/test_upscale_qt.py @@ -96,6 +96,22 @@ def test_compare_view(): assert shot.pixelColor(300, 200) == QColor('blue') +def test_main_window(): + w = uq.Main() + w.cfg.setValue('imajev_model', '') # never run the real VLM in tests + w.cfg.setValue('upscalers_dir', os.path.join(TMP, 'models')) + w.reload_models() + assert not w.a_up.isEnabled() # no image yet + path = os.path.join(TMP, 'in.png') + img = QImage(8, 6, QImage.Format.Format_RGB32) + img.fill(QColor('green')) + img.save(path) + w.load(path) + assert len(w.jobs) == 1 and w.jobs[0].image.size() == img.size() + assert os.path.exists(w.jobs[0].input) + assert w.a_up.isEnabled() and not w.a_save.isEnabled() + + if __name__ == '__main__': for name, fn in list(globals().items()): if name.startswith('test_'): |
