Skip to content

Commit 375274a

Browse files
authored
Merge pull request #394 from Australian-Imaging-Service/test-imports
updated pydra2app imports
2 parents e7be856 + 78d8426 commit 375274a

File tree

7 files changed

+74
-70
lines changed

7 files changed

+74
-70
lines changed

specs/australian-imaging-service/quality-control/phi-finder.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
schema_version: '2.0'
22
title: PHI-Finder
3-
version: &version '2025.7.2'
3+
version: '2025.7.2.post1'
44
authors:
55
- name: Pedro Faustini
66
email: pedro.faustini@mq.edu.au
@@ -23,7 +23,7 @@ packages:
2323
conda:
2424
tesseract: 5.5.0
2525
pip:
26-
phi-finder: *version
26+
phi-finder: '2025.7.2'
2727
torch: 2.6.0
2828
thinc: 8.3.4
2929
commands:

src/australianimagingservice/mri/human/neuro/t1w/tests/test_preprocess.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
2-
from pipeline2app.core import App
2+
from pydra2app.core import App
33
from australianimagingservice.mri.human.neuro.t1w.preprocess import all_parcs
44

55
PKG_DIR = (

tests/test_bids_apps.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import json
2-
from pipeline2app.core.cli import make
3-
from pipeline2app.xnat import XnatApp
2+
from pydra2app.core.cli import make
3+
from pydra2app.xnat import XnatApp
44
from frametree.core.utils import show_cli_trace
5-
from pipeline2app.xnat.deploy import install_and_launch_xnat_cs_command
5+
from pydra2app.xnat.deploy import install_and_launch_xnat_cs_command
66

77

88
SKIP_BUILD = False

tests/test_cli_docs.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
11
import os
22
from pathlib import Path
33
from click.testing import CliRunner
4-
from pipeline2app.core.cli import make_docs
4+
from pydra2app.core.cli import make_docs
55

66
PKG_PATH = Path(__file__).parent.parent.absolute()
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_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from frametree.core.utils import show_cli_trace
2-
from pipeline2app.core.cli import make_docs
2+
from pydra2app.core.cli import make_docs
33

44

55
def test_make_docs(bids_app_spec_path, cli_runner, work_dir):

tests/test_make.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
from pathlib import Path
22
from click.testing import CliRunner
3-
from pipeline2app.core.cli import make
3+
from pydra2app.core.cli import make
44
from frametree.core.utils import show_cli_trace
55

66
PKG_PATH = Path(__file__).parent.parent.absolute()
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)