Skip to content

Commit

Permalink
Moved tests folder out of src (#261)
Browse files Browse the repository at this point in the history
* Moved tests folder out of src

* run-tests points at correct folder

---------

Co-authored-by: ruaridhg <[email protected]>
  • Loading branch information
ruaridhg and ruaridhg authored Jan 29, 2024
1 parent fc2ea7c commit 23b0917
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pixl_dcmd/bin/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ BIN_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
PACKAGE_DIR="${BIN_DIR%/*}"
cd "$PACKAGE_DIR"

pytest src/pixl_dcmd/tests
pytest tests
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
def tag_scheme() -> dict:
"""Read the tag scheme from orthanc raw."""
tag_file = (
pathlib.Path(__file__).parents[4]
pathlib.Path(__file__).parents[2]
/ "orthanc/orthanc-anon/plugin/tag-operations.yaml"
)
return yaml.safe_load(tag_file.read_text())
Expand All @@ -57,7 +57,7 @@ def test_image_already_exported_throws(rows_in_session, tag_scheme):
WHEN the dicom tag scheme is applied
THEN an exception will be thrown as
"""
exported_dicom = pathlib.Path(__file__).parents[4] / "test/resources/Dicom1.dcm"
exported_dicom = pathlib.Path(__file__).parents[2] / "test/resources/Dicom1.dcm"
input_dataset = pydicom.dcmread(exported_dicom)

with pytest.raises(sqlalchemy.exc.NoResultFound):
Expand All @@ -71,7 +71,7 @@ def test_pseudo_identifier_processing(rows_in_session, tag_scheme):
THEN the patient identifier tag should be the mrn and accession hashed
and the pipeline db row should now have the fake hash
"""
exported_dicom = pathlib.Path(__file__).parents[4] / "test/resources/Dicom2.dcm"
exported_dicom = pathlib.Path(__file__).parents[2] / "test/resources/Dicom2.dcm"
input_dataset = pydicom.dcmread(exported_dicom)

accession_number = "AA12345605"
Expand Down

0 comments on commit 23b0917

Please sign in to comment.