From 35c894a532b8c8e438d606889937bc9745d3e41d Mon Sep 17 00:00:00 2001 From: Gabrielle Duplan Date: Mon, 15 Jul 2024 16:35:09 -0400 Subject: [PATCH] Add test --- girder/test_girder/test_large_image.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/girder/test_girder/test_large_image.py b/girder/test_girder/test_large_image.py index fb9ab6a39..ddf13f876 100644 --- a/girder/test_girder/test_large_image.py +++ b/girder/test_girder/test_large_image.py @@ -237,6 +237,25 @@ def testThumbnailFileJob(server, admin, user, fsAssetstore): Setting().set(constants.PluginSettings.LARGE_IMAGE_MAX_THUMBNAIL_FILES, 0) +@pytest.mark.usefixtures('unbindLargeImage') +@pytest.mark.plugin('large_image') +def testFolderCreateImages(server, admin, user, fsAssetstore): + file = utilities.uploadExternalFile('sample_image.ptif', admin, fsAssetstore) + itemId = file['itemId'] + item = Item().load(itemId, user=admin) + folderId = str(item['folderId']) + # Remove the large image from this item + ImageItem().delete(item) + # Ask to make all items in this folder large images + resp = server.request( + method='PUT', path=f'/large_image/folder/{folderId}/tiles', user=admin) + assert utilities.respStatus(resp) == 200 + assert resp.json['largeImagesCreated'] == 1 + item = Item().load(itemId, user=admin) + # Check that this item became a large image again + assert 'largeImage' in item + + @pytest.mark.singular() @pytest.mark.usefixtures('unbindLargeImage') @pytest.mark.plugin('large_image')