| Total Complexity | 6 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/env python |
||
| 2 | |||
| 3 | """Tests for Image.""" |
||
| 4 | |||
| 5 | from torchio import INTENSITY, Image |
||
| 6 | from ..utils import TorchioTestCase |
||
| 7 | |||
| 8 | |||
| 9 | class TestImage(TorchioTestCase): |
||
| 10 | """Tests for `Image`.""" |
||
| 11 | |||
| 12 | def test_image_not_found(self): |
||
| 13 | with self.assertRaises(FileNotFoundError): |
||
| 14 | Image('nopath', INTENSITY) |
||
| 15 | |||
| 16 | def test_wrong_path_type(self): |
||
| 17 | with self.assertRaises(TypeError): |
||
| 18 | Image(5, INTENSITY) |
||
| 19 | |||
| 20 | def test_bad_key(self): |
||
| 21 | with self.assertRaises(ValueError): |
||
| 22 | Image(5, INTENSITY, affine=1) |
||
| 23 |