(self, data_shape, filenames, expected_shape, dtype)
| 84 | |
| 85 | @parameterized.expand([TEST_CASE_7]) |
| 86 | def test_read_list(self, data_shape, filenames, expected_shape, dtype): |
| 87 | test_image = np.random.rand(*data_shape).astype(dtype) |
| 88 | with tempfile.TemporaryDirectory() as tempdir: |
| 89 | for i, filename in enumerate(filenames): |
| 90 | filenames[i] = os.path.join(tempdir, filename) |
| 91 | nrrd.write(filenames[i], test_image.astype(dtype)) |
| 92 | reader = NrrdReader() |
| 93 | results = reader.read(filenames) |
| 94 | for result in results: |
| 95 | self.assertTupleEqual(result.array.shape, expected_shape) |
| 96 | self.assertTupleEqual(tuple(result.header["sizes"]), expected_shape) |
| 97 | np.testing.assert_allclose(result.array, test_image) |
| 98 | |
| 99 | @parameterized.expand([TEST_CASE_8]) |
| 100 | def test_read_with_header(self, data_shape, filename, expected_shape, dtype, reference_header): |
nothing calls this directly
no test coverage detected