From 28a89d1842a018b4c9f32ba91d60cadb71823ecf Mon Sep 17 00:00:00 2001 From: matt clifford Date: Wed, 9 Oct 2024 17:01:06 +0100 Subject: [PATCH] move kodak data and morie tests for datasets --- IQM_Vis/examples/KODAK_dataset/__init__.py | 9 ++++ .../kodim01.png | Bin .../kodim02.png | Bin .../kodim03.png | Bin .../kodim05.png | Bin .../kodim06.png | Bin .../kodim07.png | Bin .../kodim08.png | Bin .../kodim11.png | Bin .../kodim12.png | Bin .../kodim13.png | Bin .../kodim14.png | Bin .../kodim15.png | Bin .../kodim16.png | Bin .../kodim20.png | Bin .../kodim21.png | Bin .../kodim22.png | Bin .../kodim23.png | Bin .../kodim24.png | Bin .../p-kodim04.png | Bin .../p-kodim09.png | Bin .../p-kodim10.png | Bin .../p-kodim17.png | Bin .../p-kodim18.png | Bin .../p-kodim19.png | Bin IQM_Vis/examples/__init__.py | 6 +-- IQM_Vis/examples/dataset.py | 7 +-- IQM_Vis/examples/experiment.py | 51 ------------------ IQM_Vis/examples/kodak.py | 12 +---- IQM_Vis/examples/multiple.py | 42 --------------- IQM_Vis/examples/new_api.py | 34 ------------ IQM_Vis/examples/simple.py | 27 ---------- IQM_Vis/ui_wrapper.py | 1 + tests/UI/test_check_args.py | 22 ++++++++ ...t_sliders.py => test_dataset_scrolling.py} | 46 ++++++++++++++-- tests/reports/coverage_badge.svg | 2 +- tests/reports/junit/junit.xml | 2 +- tests/reports/tests_badge.svg | 2 +- 38 files changed, 83 insertions(+), 180 deletions(-) create mode 100644 IQM_Vis/examples/KODAK_dataset/__init__.py rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim01.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim02.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim03.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim05.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim06.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim07.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim08.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim11.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim12.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim13.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim14.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim15.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim16.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim20.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim21.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim22.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim23.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/kodim24.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/p-kodim04.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/p-kodim09.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/p-kodim10.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/p-kodim17.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/p-kodim18.png (100%) rename IQM_Vis/examples/{KODAK-dataset => KODAK_dataset}/p-kodim19.png (100%) delete mode 100644 IQM_Vis/examples/experiment.py delete mode 100644 IQM_Vis/examples/multiple.py delete mode 100644 IQM_Vis/examples/new_api.py delete mode 100644 IQM_Vis/examples/simple.py create mode 100644 tests/UI/test_check_args.py rename tests/UI/{test_sliders.py => test_dataset_scrolling.py} (54%) diff --git a/IQM_Vis/examples/KODAK_dataset/__init__.py b/IQM_Vis/examples/KODAK_dataset/__init__.py new file mode 100644 index 0000000..81daf5e --- /dev/null +++ b/IQM_Vis/examples/KODAK_dataset/__init__.py @@ -0,0 +1,9 @@ +import os +import glob + +dir = os.path.dirname(os.path.abspath(__file__)) + +KODAK_IMAGES = glob.glob(os.path.join(dir, '*')) +# remove and folders +KODAK_IMAGES = [f for f in KODAK_IMAGES if os.path.isfile(f)] +KODAK_IMAGES.sort() diff --git a/IQM_Vis/examples/KODAK-dataset/kodim01.png b/IQM_Vis/examples/KODAK_dataset/kodim01.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim01.png rename to IQM_Vis/examples/KODAK_dataset/kodim01.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim02.png b/IQM_Vis/examples/KODAK_dataset/kodim02.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim02.png rename to IQM_Vis/examples/KODAK_dataset/kodim02.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim03.png b/IQM_Vis/examples/KODAK_dataset/kodim03.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim03.png rename to IQM_Vis/examples/KODAK_dataset/kodim03.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim05.png b/IQM_Vis/examples/KODAK_dataset/kodim05.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim05.png rename to IQM_Vis/examples/KODAK_dataset/kodim05.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim06.png b/IQM_Vis/examples/KODAK_dataset/kodim06.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim06.png rename to IQM_Vis/examples/KODAK_dataset/kodim06.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim07.png b/IQM_Vis/examples/KODAK_dataset/kodim07.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim07.png rename to IQM_Vis/examples/KODAK_dataset/kodim07.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim08.png b/IQM_Vis/examples/KODAK_dataset/kodim08.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim08.png rename to IQM_Vis/examples/KODAK_dataset/kodim08.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim11.png b/IQM_Vis/examples/KODAK_dataset/kodim11.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim11.png rename to IQM_Vis/examples/KODAK_dataset/kodim11.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim12.png b/IQM_Vis/examples/KODAK_dataset/kodim12.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim12.png rename to IQM_Vis/examples/KODAK_dataset/kodim12.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim13.png b/IQM_Vis/examples/KODAK_dataset/kodim13.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim13.png rename to IQM_Vis/examples/KODAK_dataset/kodim13.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim14.png b/IQM_Vis/examples/KODAK_dataset/kodim14.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim14.png rename to IQM_Vis/examples/KODAK_dataset/kodim14.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim15.png b/IQM_Vis/examples/KODAK_dataset/kodim15.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim15.png rename to IQM_Vis/examples/KODAK_dataset/kodim15.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim16.png b/IQM_Vis/examples/KODAK_dataset/kodim16.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim16.png rename to IQM_Vis/examples/KODAK_dataset/kodim16.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim20.png b/IQM_Vis/examples/KODAK_dataset/kodim20.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim20.png rename to IQM_Vis/examples/KODAK_dataset/kodim20.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim21.png b/IQM_Vis/examples/KODAK_dataset/kodim21.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim21.png rename to IQM_Vis/examples/KODAK_dataset/kodim21.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim22.png b/IQM_Vis/examples/KODAK_dataset/kodim22.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim22.png rename to IQM_Vis/examples/KODAK_dataset/kodim22.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim23.png b/IQM_Vis/examples/KODAK_dataset/kodim23.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim23.png rename to IQM_Vis/examples/KODAK_dataset/kodim23.png diff --git a/IQM_Vis/examples/KODAK-dataset/kodim24.png b/IQM_Vis/examples/KODAK_dataset/kodim24.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/kodim24.png rename to IQM_Vis/examples/KODAK_dataset/kodim24.png diff --git a/IQM_Vis/examples/KODAK-dataset/p-kodim04.png b/IQM_Vis/examples/KODAK_dataset/p-kodim04.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/p-kodim04.png rename to IQM_Vis/examples/KODAK_dataset/p-kodim04.png diff --git a/IQM_Vis/examples/KODAK-dataset/p-kodim09.png b/IQM_Vis/examples/KODAK_dataset/p-kodim09.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/p-kodim09.png rename to IQM_Vis/examples/KODAK_dataset/p-kodim09.png diff --git a/IQM_Vis/examples/KODAK-dataset/p-kodim10.png b/IQM_Vis/examples/KODAK_dataset/p-kodim10.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/p-kodim10.png rename to IQM_Vis/examples/KODAK_dataset/p-kodim10.png diff --git a/IQM_Vis/examples/KODAK-dataset/p-kodim17.png b/IQM_Vis/examples/KODAK_dataset/p-kodim17.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/p-kodim17.png rename to IQM_Vis/examples/KODAK_dataset/p-kodim17.png diff --git a/IQM_Vis/examples/KODAK-dataset/p-kodim18.png b/IQM_Vis/examples/KODAK_dataset/p-kodim18.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/p-kodim18.png rename to IQM_Vis/examples/KODAK_dataset/p-kodim18.png diff --git a/IQM_Vis/examples/KODAK-dataset/p-kodim19.png b/IQM_Vis/examples/KODAK_dataset/p-kodim19.png similarity index 100% rename from IQM_Vis/examples/KODAK-dataset/p-kodim19.png rename to IQM_Vis/examples/KODAK_dataset/p-kodim19.png diff --git a/IQM_Vis/examples/__init__.py b/IQM_Vis/examples/__init__.py index 9fe3cf5..a45d672 100644 --- a/IQM_Vis/examples/__init__.py +++ b/IQM_Vis/examples/__init__.py @@ -1,6 +1,2 @@ -from IQM_Vis.examples.multiple import run -from IQM_Vis.examples.simple import run -from IQM_Vis.examples.dataset import run -from IQM_Vis.examples.all import run -from IQM_Vis.examples.kodak import run import IQM_Vis.examples.images +import IQM_Vis.examples.kodak diff --git a/IQM_Vis/examples/dataset.py b/IQM_Vis/examples/dataset.py index 2c315db..a15f463 100644 --- a/IQM_Vis/examples/dataset.py +++ b/IQM_Vis/examples/dataset.py @@ -21,9 +21,10 @@ def run(): # make dataset list of images file_path = os.path.dirname(os.path.abspath(__file__)) - dataset = [os.path.join(file_path, 'images', 'waves1.jpeg'), - os.path.join(file_path, 'images', 'waves2.jpeg'), - os.path.join(file_path, 'images', 'waves3.jpeg')] + dataset = [IQM_Vis.examples.images.IMAGE1, + IQM_Vis.examples.images.IMAGE2, + IQM_Vis.examples.images.IMAGE3] + data = IQM_Vis.dataset_holder(dataset, metric, metric_images, diff --git a/IQM_Vis/examples/experiment.py b/IQM_Vis/examples/experiment.py deleted file mode 100644 index 632a0c7..0000000 --- a/IQM_Vis/examples/experiment.py +++ /dev/null @@ -1,51 +0,0 @@ -# Author: Matt Clifford -# License: BSD 3-Clause License - -import os -import numpy as np -import IQM_Vis - - -def run(): - # metrics functions must return a single value - metric = {'DISTS': IQM_Vis.metrics.DISTS(), - 'MAE': IQM_Vis.metrics.MAE(), - '1-SSIM': IQM_Vis.metrics.SSIM(), - # '1-MS_SSIM': IQM_Vis.metrics.MS_SSIM(), - 'NLPD': IQM_Vis.metrics.NLPD(), - # 'LPIPS': IQM_Vis.metrics.LPIPS(), - } - - # metrics images return a numpy image - metric_images = {} - - # make dataset list of images - file_path = os.path.dirname(os.path.abspath(__file__)) - dataset = [os.path.join(file_path, 'images', 'waves1.jpeg'), - os.path.join(file_path, 'images', 'waves2.jpeg'), - os.path.join(file_path, 'images', 'waves3.jpeg')] - data = IQM_Vis.dataset_holder(dataset, - metric, - metric_images, - IQM_Vis.utils.load_image, - ) - - # define the transformations - transformations = { - # 'contrast': {'min': 0.5, 'max': 2.5, 'function': IQM_Vis.transforms.contrast, 'init_value': 1.0}, - 'Gaussian Noise': {'min': 0, 'max': 0.3, 'function': IQM_Vis.transforms.Gaussian_noise, 'init_value': 0.0}, - # 'hue': {'min': -0.5, 'max': 0.5, 'function': IQM_Vis.transforms.hue}, - # 'saturation': {'min': -0.5, 'max': 0.5, 'function': IQM_Vis.transforms.saturation}, - # 'jpg compr': {'init_value': 101, 'min': 1, 'max': 101, 'function': IQM_Vis.transforms.jpeg_compression}, - # # only odd ints - # 'blur': {'min': 1, 'max': 41, 'normalise': 'odd', 'function': IQM_Vis.transforms.blur}, - } - - # use the API to create the UI - IQM_Vis.make_UI(data, - transformations, - restrict_options=4, - num_steps_range=6) - -if __name__ == '__main__': - run() diff --git a/IQM_Vis/examples/kodak.py b/IQM_Vis/examples/kodak.py index 621aec6..43b63c6 100644 --- a/IQM_Vis/examples/kodak.py +++ b/IQM_Vis/examples/kodak.py @@ -2,22 +2,14 @@ # Author: Matt Clifford # License: BSD 3-Clause License -import os -import glob import IQM_Vis +from IQM_Vis.examples.KODAK_dataset import KODAK_IMAGES def run(): - file_path = os.path.dirname(os.path.abspath(__file__)) - dir = os.path.join(file_path, 'KODAK-dataset') - image_list = glob.glob(os.path.join(dir, '*')) - # remove and folders - image_list = [f for f in image_list if os.path.isfile(f)] - image_list.sort() - metrs = IQM_Vis.metrics.get_all_metrics() if '1-MS_SSIM' in metrs: metrs.pop('1-MS_SSIM') - data = IQM_Vis.dataset_holder(image_list, + data = IQM_Vis.dataset_holder(KODAK_IMAGES, metrs, # IQM_Vis.metrics.get_all_metric_images() ) diff --git a/IQM_Vis/examples/multiple.py b/IQM_Vis/examples/multiple.py deleted file mode 100644 index cc84ce8..0000000 --- a/IQM_Vis/examples/multiple.py +++ /dev/null @@ -1,42 +0,0 @@ -# Author: Matt Clifford -# License: BSD 3-Clause License - -import os -import numpy as np -import IQM_Vis - - -def run(): - file_path = os.path.dirname(os.path.abspath(__file__)) - - # metrics functions must return a single value - metric = {'MAE': IQM_Vis.metrics.MAE(), - 'MSE': IQM_Vis.metrics.MSE(), - '1-SSIM': IQM_Vis.metrics.SSIM()} - - # metrics images return a numpy image - metric_images = {'MSE': IQM_Vis.metrics.MSE(return_image=True), - 'SSIM': IQM_Vis.metrics.SSIM(return_image=True)} - - # first row of images - row_1 = IQM_Vis.dataset_holder([os.path.join(file_path, 'images', 'waves2.jpeg')], - metric, - metric_images) - # second row of images - row_2 = IQM_Vis.dataset_holder([os.path.join(file_path, 'images', 'waves3.jpeg')], - metric, - metric_images) - # define the transformations - transformations = { - 'rotation':{'min':-180, 'max':180, 'function':IQM_Vis.transforms.rotation}, # normal input - 'blur':{'min':1, 'max':41, 'normalise':'odd', 'function':IQM_Vis.transforms.blur}, # only odd ints - 'brightness':{'min':-1.0, 'max':1.0, 'function':IQM_Vis.transforms.brightness}, # normal but with float - } - - # use the API to create the UI - IQM_Vis.make_UI([row_1, row_2], - transformations) - - -if __name__ == '__main__': - run() diff --git a/IQM_Vis/examples/new_api.py b/IQM_Vis/examples/new_api.py deleted file mode 100644 index 6a2e390..0000000 --- a/IQM_Vis/examples/new_api.py +++ /dev/null @@ -1,34 +0,0 @@ -''' KODAK dataset ''' -# Author: Matt Clifford -# License: BSD 3-Clause License - -import os -import glob -import IQM_Vis - -def run(): - # file_path = os.path.dirname(os.path.abspath(__file__)) - # dir = os.path.join(file_path, 'KODAK-dataset') - - dir = os.path.join(os.path.expanduser('~'), 'Desktop', 'demo') - image_list = glob.glob(os.path.join(dir, '*')) - # remove and folders - image_list = [f for f in image_list if os.path.isfile(f)] - image_list.sort() - - metrs = IQM_Vis.metrics.get_all_metrics() - metrs.pop('1-MS_SSIM') - - metr_ims = IQM_Vis.metrics.get_all_metric_images() - metr_ims.pop('MSE') - - IQM_Vis.make_UI(transformations=IQM_Vis.transforms.get_all_transforms(), - image_list=image_list, - metrics=metrs, - metric_images=metr_ims, - restrict_options=3 - ) - IQM_Vis.make_UI() - -if __name__ == '__main__': - run() \ No newline at end of file diff --git a/IQM_Vis/examples/simple.py b/IQM_Vis/examples/simple.py deleted file mode 100644 index 1f91245..0000000 --- a/IQM_Vis/examples/simple.py +++ /dev/null @@ -1,27 +0,0 @@ -# Author: Matt Clifford -# License: BSD 3-Clause License - -import os -import numpy as np -import IQM_Vis - - -def run(): - file_path = os.path.dirname(os.path.abspath(__file__)) - # define simple metrics - metric = {'MAE': lambda im1, im2: np.abs(im1 - im2).mean()} - metric_im = {'MAE': lambda im1, im2: np.abs(im1 - im2)} - # add numpy image and the metrics to the data handler - data_store = IQM_Vis.dataset_holder(image_list=[os.path.join(file_path, 'images', 'waves3.jpeg')], - metrics=metric, - metric_images=metric_im) - # define the transformations - trans = {'brightness': {'min':-1.0, 'max':1.0, 'init_value':0, 'function':lambda im, val: np.clip(im + val, 0, 1)}} - # use the API to create the UI - IQM_Vis.make_UI([data_store], - trans, - metrics_info_format='text') - - -if __name__ == '__main__': - run() diff --git a/IQM_Vis/ui_wrapper.py b/IQM_Vis/ui_wrapper.py index f40e3fa..75485f2 100644 --- a/IQM_Vis/ui_wrapper.py +++ b/IQM_Vis/ui_wrapper.py @@ -24,6 +24,7 @@ except ImportError: warnings.warn('Cannot load PyQt6 library - running IQM_Vis package in headless mode') + class make_UI: def __init__(self, data_store=None, diff --git a/tests/UI/test_check_args.py b/tests/UI/test_check_args.py new file mode 100644 index 0000000..86503bd --- /dev/null +++ b/tests/UI/test_check_args.py @@ -0,0 +1,22 @@ +# Author: Matt Clifford +# License: BSD 3-Clause License + +from tests.QtBot_utils import BotTester +import IQM_Vis + +import sys +import os +sys.path.append(os.path.abspath('..')) + + +def get_UI(): + app = IQM_Vis.make_UI(test=True, debug=True) + return app + + +build_IQM_Vis = BotTester(get_UI=get_UI).build_IQM_Vis + + +def test_dev_true(build_IQM_Vis): + test_window, _ = build_IQM_Vis + assert test_window.showing == True diff --git a/tests/UI/test_sliders.py b/tests/UI/test_dataset_scrolling.py similarity index 54% rename from tests/UI/test_sliders.py rename to tests/UI/test_dataset_scrolling.py index 5733a50..b4ab70a 100644 --- a/tests/UI/test_sliders.py +++ b/tests/UI/test_dataset_scrolling.py @@ -1,16 +1,17 @@ # Author: Matt Clifford # License: BSD 3-Clause License +from PyQt6 import QtTest, QtCore + import IQM_Vis import sys import os sys.path.append(os.path.abspath('..')) +import IQM_Vis.examples.KODAK_dataset from tests.QtBot_utils import BotTester def get_UI(): - image1 = IQM_Vis.examples.images.IMAGE1 - image2 = IQM_Vis.examples.images.IMAGE2 - images = [image1, image2] + images = IQM_Vis.examples.KODAK_dataset.KODAK_IMAGES MAE = IQM_Vis.metrics.MAE() MSE = IQM_Vis.metrics.MSE() @@ -44,7 +45,7 @@ def get_UI(): test_app = IQM_Vis.make_UI(transformations=transformations, image_list=images, metrics=metrics, - metric_images=metric_images, + # metric_images=metric_images, test=True) return test_app @@ -52,6 +53,41 @@ def get_UI(): build_IQM_Vis = BotTester(get_UI=get_UI, wait_time=1000, final_wait=True).build_IQM_Vis -def test_sliders(build_IQM_Vis): +def test_dataset_scrolling(build_IQM_Vis): test_window, qtbotbis = build_IQM_Vis assert test_window.showing == True + + QtTest.QTest.qWait(500) + + # cycle the dataset backwards + for _ in range(2): + button = test_window.window.widget_controls['button']['prev_data'] + qtbotbis.mouseClick(button, QtCore.Qt.MouseButton.LeftButton) + QtTest.QTest.qWait(500) + # check not crashed + assert test_window.showing == True + + # click on an image to change the image + for i in range(1,5): + image = test_window.window.widget_controls['images'][i] + qtbotbis.mouseClick(image, QtCore.Qt.MouseButton.LeftButton) + QtTest.QTest.qWait(500) + + # cycle the dataset forwards + for _ in range(3): + button = test_window.window.widget_controls['button']['prev_data'] + qtbotbis.mouseClick(button, QtCore.Qt.MouseButton.LeftButton) + QtTest.QTest.qWait(500) + # check not crashed + assert test_window.showing == True + + # click on an image to change the image + for i in range(1,5): + image = test_window.window.widget_controls['images'][i] + qtbotbis.mouseClick(image, QtCore.Qt.MouseButton.LeftButton) + QtTest.QTest.qWait(500) + # check not crashed + assert test_window.showing == True + + + diff --git a/tests/reports/coverage_badge.svg b/tests/reports/coverage_badge.svg index d9a27cb..5aaa700 100644 --- a/tests/reports/coverage_badge.svg +++ b/tests/reports/coverage_badge.svg @@ -1 +1 @@ -coverage: 69.03%coverage69.03% \ No newline at end of file +coverage: 69.90%coverage69.90% \ No newline at end of file diff --git a/tests/reports/junit/junit.xml b/tests/reports/junit/junit.xml index 9ac3cd3..de7930f 100644 --- a/tests/reports/junit/junit.xml +++ b/tests/reports/junit/junit.xml @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/tests/reports/tests_badge.svg b/tests/reports/tests_badge.svg index 4b669ad..69ca359 100644 --- a/tests/reports/tests_badge.svg +++ b/tests/reports/tests_badge.svg @@ -1 +1 @@ -tests: 13tests13 \ No newline at end of file +tests: 14tests14 \ No newline at end of file