aboutsummaryrefslogtreecommitdiffstats
path: root/test_upscale_qt.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-30 19:03:55 +0100
committerDanilo M. <danix@danix.xyz>2026-10-30 19:03:55 +0100
commit610bf7f3432037f7f8cfb641b05e39e48830f82a (patch)
treeb2841a2cbfa022ed87789eca5af73e44fd7eb951 /test_upscale_qt.py
parentfd5eb858f89c7a39506abb2aeea8756fd1228763 (diff)
downloadupscale-qt-610bf7f3432037f7f8cfb641b05e39e48830f82a.tar.gz
upscale-qt-610bf7f3432037f7f8cfb641b05e39e48830f82a.zip
Add main window: open, suggest, upscale, save as, overwrite
One QProcess drives both tools; Open and Upscale are disabled while it runs so a result never lands on a replaced job. Images load with EXIF orientation applied and go to sd-cli and imajev as an upright PNG. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'test_upscale_qt.py')
-rw-r--r--test_upscale_qt.py16
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_'):