From 610bf7f3432037f7f8cfb641b05e39e48830f82a Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 30 Oct 2026 19:03:55 +0100 Subject: 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 --- test_upscale_qt.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test_upscale_qt.py') 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_'): -- cgit v1.2.3