Skip to content

Commit

Permalink
ENH: test __repr__ in datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
ncullen93 committed Mar 28, 2024
1 parent 948fecd commit ca09938
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ def test_2d(self):
dataset = datasets.MemoryDataset(x, y)
self.assertTrue(len(dataset.x) == 10)

# test repr
r = dataset.__repr__()

def test_3d(self):
x = [self.img3d for _ in range(10)]
y = list(range(10))
Expand Down Expand Up @@ -90,6 +93,9 @@ def test_2d(self):
x, y = dataset[:2]
self.assertTrue(len(x) == 2)

# test repr
r = dataset.__repr__()

def test_double_image_input(self):
dataset = datasets.FolderDataset(
base_dir=self.tmp_dir,
Expand Down Expand Up @@ -173,6 +179,9 @@ def test_2d(self):
x, y = dataset[:2]
self.assertTrue(len(x) == 2)

# test repr
r = dataset.__repr__()

def test_3d(self):
dataset = datasets.CSVDataset(
path=os.path.join(self.tmp_dir, 'participants.csv'),
Expand Down Expand Up @@ -227,6 +236,9 @@ def test_2d(self):
x, y = dataset[:2]
self.assertTrue(len(x) == 2)

# test repr
r = dataset.__repr__()

def test_3d(self):
dataset = datasets.BIDSDataset(self.tmp_dir,
x={'datatype': 'anat', 'suffix': 'T2w'},
Expand Down

0 comments on commit ca09938

Please sign in to comment.