Passed
Pull Request — master (#246)
by Fernando
01:07
created

TestRandomSampler.test_not_implemented()   A

Complexity

Conditions 3

Size

Total Lines 6
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 6
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
import torch
2
import torchio
3
import numpy as np
4
from torchio.data.sampler import RandomSampler
5
from ...utils import TorchioTestCase
6
7
8
class TestRandomSampler(TorchioTestCase):
9
    """Tests for `RandomSampler` class."""
10
    def test_not_implemented(self):
11
        sampler = RandomSampler(1)
12
        with self.assertRaises(NotImplementedError):
13
            sampler(self.sample, 5)
14
        with self.assertRaises(NotImplementedError):
15
            sampler.get_probability_map(self.sample)
16