Skip to content

Commit

Permalink
Add tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Jul 5, 2022
1 parent 44e79c7 commit 486784c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/test_source_tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,22 @@ def testStyleMinMaxThreshold():
assert numpy.any(image != imageB)
assert image[0][0][0] == 252
assert imageB[0][0][0] == 254
sourceC = large_image_source_tiff.open(
imagePath, style=json.dumps({'min': 'full', 'max': 'full'}))
imageC, _ = sourceC.getRegion(
output={'maxWidth': 256, 'maxHeight': 256}, format=constants.TILE_FORMAT_NUMPY)
assert numpy.any(image != imageC)
assert imageC[0][0][0] == 253


def testStyleDtypeAxis():
imagePath = datastore.fetch('sample_image.ptif')
source = large_image_source_tiff.open(
imagePath, style=json.dumps({'dtype': 'uint16', 'axis': 1}))
image, _ = source.getRegion(
output={'maxWidth': 456, 'maxHeight': 96}, format=constants.TILE_FORMAT_NUMPY)
assert image.shape[2] == 1
assert image[0][0][0] == 65021


def testStyleNoData():
Expand Down

0 comments on commit 486784c

Please sign in to comment.