diff options
Diffstat (limited to 'Wrappers/Python/test/test_DataContainer.py')
-rwxr-xr-x | Wrappers/Python/test/test_DataContainer.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Wrappers/Python/test/test_DataContainer.py b/Wrappers/Python/test/test_DataContainer.py index d2d5b05..6e297ee 100755 --- a/Wrappers/Python/test/test_DataContainer.py +++ b/Wrappers/Python/test/test_DataContainer.py @@ -744,7 +744,24 @@ class TestDataContainer(unittest.TestCase): res = numpy.ones_like(d1.as_array()) * 4. numpy.testing.assert_array_equal(res, out.as_array()) - + def test_min(self): + print ("test min") + ig = ImageGeometry(10,10) + a = numpy.asarray(numpy.linspace(-10,10, num=100, endpoint=True), dtype=numpy.float32) + a = a.reshape((10,10)) + d1 = ig.allocate(1) + d1.fill(a) + self.assertAlmostEqual(d1.min(), -10.) + + def test_max(self): + print ("test max") + ig = ImageGeometry(10,10) + a = numpy.asarray(numpy.linspace(-10,10, num=100, endpoint=True), dtype=numpy.float32) + a = a.reshape((10,10)) + d1 = ig.allocate(1) + d1.fill(a) + self.assertAlmostEqual(d1.max(), 10.) + |