forked from ilastik/lazyflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestHelpers.py
30 lines (25 loc) · 894 Bytes
/
testHelpers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from __future__ import print_function
from unittest import TestCase
from lazyflow.utility import helpers
class TestDefaultAxisOrdering(TestCase):
"""Class for testing the default axis ordering"""
def testValidShapes(self):
testshapes = [
((10, 20), 'yx'),
((10, 20, 30), 'zyx'),
((10, 20, 30, 3), 'zyxc'),
((5, 10, 20, 30, 3), 'tzyxc')
]
for shape, expected_axes_string in testshapes:
default_axes = helpers.get_default_axisordering(shape)
assert default_axes == expected_axes_string
def testInvalidShapes(self):
testshapes = [
tuple(),
tuple([1]),
(1, 2, 3, 4, 5, 6),
]
for shape in testshapes:
print(shape)
self.assertRaises(
ValueError, helpers.get_default_axisordering, shape)