Skip to content

Commit

Permalink
fix for integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Roy Wiggins authored and Roy Wiggins committed Nov 25, 2024
1 parent d6275dc commit d67d30e
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,18 +169,21 @@ def test_case_error_real(mercure, mercure_config, mercure_base, receiver_port, b
}

mercure_config(config)
supervisor = mercure(["receiver"])
time.sleep(1)
ds = [create_minimal_dicom(None, None, additional_tags={'PatientName': 'Greg'}) for _ in range(1)]
Path("./dcm_inject_error").write_text("3")
try:
supervisor = mercure(["receiver"])
time.sleep(1)
ds = [create_minimal_dicom(None, None, additional_tags={'PatientName': 'Greg'}) for _ in range(1)]
Path("./dcm_inject_error").write_text("3")

for d in ds:
send_dicom(d, "localhost", receiver_port)
time.sleep(1)
for d in ds:
send_dicom(d, "localhost", receiver_port)
time.sleep(1)

Path("./dcm_inject_error").unlink()
is_dicoms_in_folder(mercure_base / "data" / "incoming" / "error", ds)
supervisor.start_service("router:*")
time.sleep(5)
is_dicoms_in_folder(mercure_base / "data" / "error", ds)
assert "Unable to read extra_tags file" in (next(d for d in (mercure_base / "data" / "error").glob('*.error')).read_text())
Path("./dcm_inject_error").unlink()
is_dicoms_in_folder(mercure_base / "data" / "incoming" / "error", ds)
supervisor.start_service("router:*")
time.sleep(5)
is_dicoms_in_folder(mercure_base / "data" / "error", ds)
assert "Unable to read extra_tags file" in (next(d for d in (mercure_base / "data" / "error").glob('*.error')).read_text())
finally:
Path("./dicom_extra_tags").unlink(missing_ok=True)

0 comments on commit d67d30e

Please sign in to comment.