Passed
Push — master ( 0d2a88...eb3c35 )
by Fernando
01:36
created

tests.data.sampler.test_random_sampler   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A TestRandomSampler.test_not_implemented() 0 6 3
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