Skip to content

Commit 3d60fd0

Browse files
committed
moved tests inside pytestable functions
1 parent 3a1f555 commit 3d60fd0

File tree

3 files changed

+65
-61
lines changed

3 files changed

+65
-61
lines changed

tests/test_cli_docs.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77

88
runner = CliRunner()
99

10-
os.chdir(PKG_PATH)
1110

12-
results = runner.invoke(
13-
make_docs,
14-
[
15-
"australian-imaging-service",
16-
"docs/pipelines",
17-
"--flatten",
18-
"--default-data-space",
19-
"arcana.common:Clinical",
20-
],
21-
catch_exceptions=False,
22-
)
11+
def test_make_docs():
12+
os.chdir(PKG_PATH)
13+
14+
results = runner.invoke(
15+
make_docs,
16+
[
17+
"australian-imaging-service",
18+
"docs/pipelines",
19+
"--flatten",
20+
"--default-data-space",
21+
"arcana.common:Clinical",
22+
],
23+
catch_exceptions=False,
24+
)

tests/test_make.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,16 @@
77

88
runner = CliRunner()
99

10-
results = runner.invoke(
11-
make,
12-
[
13-
f"{PKG_PATH}/australian-imaging-service/mri/human/neuro/bidsapps/fmriprep.yaml",
14-
"xnat:XnatApp",
15-
"--raise-errors",
16-
],
17-
catch_exceptions=False,
18-
)
1910

20-
print(show_cli_trace(results))
11+
def test_make_fmriprep():
12+
results = runner.invoke(
13+
make,
14+
[
15+
f"{PKG_PATH}/australian-imaging-service/mri/human/neuro/bidsapps/fmriprep.yaml",
16+
"xnat:XnatApp",
17+
"--raise-errors",
18+
],
19+
catch_exceptions=False,
20+
)
21+
22+
print(show_cli_trace(results))

tests/test_phi_finder.py

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,42 +10,42 @@
1010
runner = CliRunner()
1111

1212

13-
result = runner.invoke(
14-
make,
15-
[
16-
"xnat",
17-
(
18-
f"{PKG_PATH}/specs/"
19-
"australian-imaging-service/quality-control/phi-finder.yaml"
20-
),
21-
"--spec-root",
22-
f"{PKG_PATH}/specs",
23-
"--registry",
24-
"ghcr.io",
25-
"--for-localhost",
26-
"--use-local-packages",
27-
"--raise-errors",
28-
],
29-
)
30-
31-
assert not result.exit_code, show_cli_trace(result)
32-
33-
34-
xlogin = xnat4tests.connect()
35-
36-
cmd_id = install_cs_command(
37-
"ghcr.io/australian-imaging-service/quality-control.phi-finder:2025.7.2",
38-
xlogin,
39-
enable=True,
40-
projects_to_enable=["dummydicomproject"],
41-
replace_existing=True,
42-
command_name="phi-finder",
43-
)
44-
45-
launch_cs_command(
46-
cmd_id,
47-
xlogin=xlogin,
48-
inputs={},
49-
project_id="dummydicomproject",
50-
session_id="dummydicomsession",
51-
)
13+
def test_phi_finder():
14+
result = runner.invoke(
15+
make,
16+
[
17+
"xnat",
18+
(
19+
f"{PKG_PATH}/specs/"
20+
"australian-imaging-service/quality-control/phi-finder.yaml"
21+
),
22+
"--spec-root",
23+
f"{PKG_PATH}/specs",
24+
"--registry",
25+
"ghcr.io",
26+
"--for-localhost",
27+
"--use-local-packages",
28+
"--raise-errors",
29+
],
30+
)
31+
32+
assert not result.exit_code, show_cli_trace(result)
33+
34+
xlogin = xnat4tests.connect()
35+
36+
cmd_id = install_cs_command(
37+
"ghcr.io/australian-imaging-service/quality-control.phi-finder:2025.7.2",
38+
xlogin,
39+
enable=True,
40+
projects_to_enable=["dummydicomproject"],
41+
replace_existing=True,
42+
command_name="phi-finder",
43+
)
44+
45+
launch_cs_command(
46+
cmd_id,
47+
xlogin=xlogin,
48+
inputs={},
49+
project_id="dummydicomproject",
50+
session_id="dummydicomsession",
51+
)

0 commit comments

Comments
 (0)