-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add custom option --upload-only to pytest. The test will only run when that argument is passed. Skipped otherwise. Minor changes to the test_parameters file.
- Loading branch information
Showing
8 changed files
with
86 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
data/ | ||
tests/test_local_parameters.json | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
{ | ||
"mdai_domain": "uab.md.ai", | ||
"mdai_domain": "md.ai", | ||
"mdai_token_env_variable": "MDAI_TOKEN", | ||
"mdai_project_id": "L1NprBvP", | ||
"mdai_dataset_id": "D_odXMLm", | ||
"mdai_label_group_id": "G_P914xZ", | ||
"mdai_label_group_id": "G_2Jy2yZ", | ||
"mdai_label_ids": { | ||
"heart": "L_W4Xx64", | ||
"inner-chest": "L_npal0d" | ||
"mylabel": "L_W4XQKd" | ||
}, | ||
"mdai_annotations_only": true, | ||
"mdai_no_fixing_metadata": false, | ||
"labels": [ | ||
"heart", | ||
"inner-chest" | ||
"mylabel", | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,27 @@ | ||
# from mdai_utils.upload import upload_data_annotation_slice | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
def test_upload_mask_annotation(mdai_setup): | ||
from mdai_utils.upload_dataset import upload_dataset | ||
|
||
|
||
def test_pytest_fixture(mdai_setup): | ||
mdai_parameters = mdai_setup["parameters"] | ||
mdai_project_id = mdai_parameters.get("mdai_project_id") | ||
assert mdai_project_id is not None | ||
|
||
|
||
@pytest.mark.upload_only( | ||
reason="Only need to upload once. run pytest tests with --upload-only to run it." | ||
) | ||
def test_upload_dataset(mdai_setup): | ||
mdai_parameters = mdai_setup["parameters"] | ||
mdai_dataset_id = mdai_parameters.get("mdai_dataset_id") | ||
current_dir = Path(__file__).parent | ||
dicom_dir = current_dir / "fixtures" / "humanct_0002_1000_1004" | ||
assert dicom_dir.exists() | ||
completed_process = upload_dataset(mdai_dataset_id, dicom_dir) | ||
process_message = completed_process.stdout.strip() | ||
print(process_message) | ||
# Check the status of subprocess | ||
assert completed_process.returncode == 0 |