Passed
Pull Request — master (#133)
by Fernando
01:29
created

tests.data.test_image.TestImage.test_bad_key()   A

Complexity

Conditions 2

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 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