Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielle6249 committed Jul 15, 2024
1 parent 90cf2ff commit 35c894a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions girder/test_girder/test_large_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 35c894a

Please sign in to comment.