From 486784c4e9678e43c138cff2a116a73c735267b3 Mon Sep 17 00:00:00 2001 From: David Manthey Date: Tue, 5 Jul 2022 15:47:34 -0400 Subject: [PATCH] Add tests. --- test/test_source_tiff.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/test_source_tiff.py b/test/test_source_tiff.py index 83044fc3f..477d3d04c 100644 --- a/test/test_source_tiff.py +++ b/test/test_source_tiff.py @@ -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():