Newer
Older
from .utils import Wrapper, run_ioc_get_output
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
def test_multiple_cell_paths(wrapper: Wrapper):
cell_path_a = wrapper.path / "cellModsA"
wrapper.run_make("cellinstall", cell_path=cell_path_a)
cell_path_b = wrapper.path / "cellModsB"
wrapper.run_make("cellinstall", cell_path=cell_path_b)
rc, outs, _ = run_ioc_get_output(
"-l", cell_path_a, "-l", cell_path_b, module=wrapper.name
)
assert rc == 0
regex = r"Module {name} version {version} found in {path}"
assert not re.search(
regex.format(
name=re.escape(wrapper.name),
version=re.escape(wrapper.version),
path=re.escape(str(cell_path_a)),
),
outs,
)
assert re.search(
regex.format(
name=re.escape(wrapper.name),
version=re.escape(wrapper.version),
path=re.escape(str(cell_path_b)),
),
outs,
)
def test_cellpath_does_not_depend_on_order(wrapper: Wrapper):
cell_path = wrapper.path / "cellMods"
wrapper.run_make("cellinstall", cell_path=cell_path)
rc, *_ = run_ioc_get_output("-l", cell_path, "-r", wrapper.name)
assert rc == 0
rc, *_ = run_ioc_get_output("-r", wrapper.name, "-l", cell_path)
assert rc == 0
def test_after_init():
rc, outs, _ = run_ioc_get_output("-c", "afterInit echo hello")
assert rc == 0
lines = outs.split("\n")
assert "hello" in lines[lines.index("iocInit") :]