forked from imcf/python-imcflibs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_definitionoptions.py
More file actions
87 lines (62 loc) Β· 2.9 KB
/
test_definitionoptions.py
File metadata and controls
87 lines (62 loc) Β· 2.9 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
"""Tests for the imcflibs.imagej.bdv.DefinitionOptions class."""
import pytest
from imcflibs.imagej.bdv import DefinitionOptions
def test_defaults():
"""Test the default options by calling all formatters on a "raw" objects."""
acitt_options = (
"multiple_angles=[NO (one angle)] "
"multiple_channels=[YES (all channels in one file)] "
"multiple_illuminations_directions=[NO (one illumination direction)] "
"multiple_tiles=[YES (one file per tile)] "
"multiple_timepoints=[NO (one time-point)] "
)
def_opts = DefinitionOptions()
assert def_opts.fmt_acitt_options() == acitt_options
def test__definition_option():
"""Test an example with wrong setting for definition option."""
test_value = "Multiple"
def_opts = DefinitionOptions()
with pytest.raises(ValueError) as excinfo:
def_opts.set_angle_definition(test_value)
assert (
str(excinfo.value)
== "Value must be one of single, multi_multi. Support for multi_single is not available for angles and illuminations"
)
def test__multiple_timepoints_files():
"""Test an example setting how to treat multiple time-points."""
acitt_options = (
"multiple_angles=[NO (one angle)] "
"multiple_channels=[YES (all channels in one file)] "
"multiple_illuminations_directions=[NO (one illumination direction)] "
"multiple_tiles=[YES (one file per tile)] "
"multiple_timepoints=[YES (one file per time-point)] "
)
def_opts = DefinitionOptions()
def_opts.set_timepoint_definition("multi_multi")
assert def_opts.fmt_acitt_options() == acitt_options
def test__multiple_channels_files_multiple_timepoints():
"""Test an example setting how to treat multiple channels and multiple time-points."""
acitt_options = (
"multiple_angles=[NO (one angle)] "
"multiple_channels=[YES (one file per channel)] "
"multiple_illuminations_directions=[NO (one illumination direction)] "
"multiple_tiles=[YES (one file per tile)] "
"multiple_timepoints=[YES (all time-points in one file)] "
)
def_opts = DefinitionOptions()
def_opts.set_channel_definition("multi_multi")
def_opts.set_timepoint_definition("multi_single")
assert def_opts.fmt_acitt_options() == acitt_options
def test_single_tile_multiple_angles_files():
"""Test an example on with one tile and multiple angle files."""
acitt_options = (
"multiple_angles=[YES (one file per angle)] "
"multiple_channels=[YES (all channels in one file)] "
"multiple_illuminations_directions=[NO (one illumination direction)] "
"multiple_tiles=[NO (one tile)] "
"multiple_timepoints=[NO (one time-point)] "
)
def_opts = DefinitionOptions()
def_opts.set_angle_definition("multi_multi")
def_opts.set_tile_definition("single")
assert def_opts.fmt_acitt_options() == acitt_options