diff options
Diffstat (limited to 'test_upscale_qt.py')
| -rw-r--r-- | test_upscale_qt.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test_upscale_qt.py b/test_upscale_qt.py index 7d7307c..70608b6 100644 --- a/test_upscale_qt.py +++ b/test_upscale_qt.py @@ -67,6 +67,14 @@ def test_progress(): assert uq.progress(b'[I] load model') is None +def test_fit_scale(): + from PyQt6.QtCore import QSize + big = QImage(40, 20, QImage.Format.Format_RGB32) + assert uq.fit_scale(big, QSize(10, 5), 2).size() == QSize(20, 10) + assert uq.fit_scale(big, QSize(10, 5), 4).size() == QSize(40, 20) + assert uq.fit_scale(big, QSize(20, 10), 4).size() == QSize(40, 20) # 2x model + + def test_save_over(): path = os.path.join(TMP, 'photo.JPG') # uppercase suffix on purpose small = QImage(4, 4, QImage.Format.Format_RGB32) |
