(self)
| 25 | |
| 26 | class TestNumpyReader(unittest.TestCase): |
| 27 | def test_npy(self): |
| 28 | test_data = np.random.randint(0, 256, size=[3, 4, 4]) |
| 29 | with tempfile.TemporaryDirectory() as tempdir: |
| 30 | filepath = os.path.join(tempdir, "test_data.npy") |
| 31 | np.save(filepath, test_data) |
| 32 | |
| 33 | reader = NumpyReader() |
| 34 | result = reader.get_data(reader.read(filepath)) |
| 35 | np.testing.assert_allclose(result[1]["spatial_shape"], test_data.shape) |
| 36 | np.testing.assert_allclose(result[0].shape, test_data.shape) |
| 37 | np.testing.assert_allclose(result[0], test_data) |
| 38 | |
| 39 | def test_npz1(self): |
| 40 | test_data1 = np.random.randint(0, 256, size=[3, 4, 4]) |
nothing calls this directly
no test coverage detected