Skip to content

Commit 2343909

Browse files
committed
rimport: Change an err msg to ensure testing coverage.
1 parent d6780c1 commit 2343909

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

rimport

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ def stage_data(src: Path, inputdata_root: Path, staging_root: Path) -> None:
106106
# TODO: Do not hard-code string here
107107
# TODO: Check whether it's IN THE DIRECTORY, not whether the path contains a string
108108
if "d651077" in str(src):
109-
raise RuntimeError(f"Source file {src.name} is already published.")
109+
raise RuntimeError(
110+
f"Source file '{src.name}' is already under staging directory '{staging_root}'."
111+
)
110112
else:
111113
raise RuntimeError(
112114
f"source not under inputdata root: {src} not in {inputdata_root}"

tests/rimport/test_stage_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def test_raises_error_for_already_published_file(
129129
src.write_text("data")
130130

131131
# Should raise RuntimeError for already published file
132-
with pytest.raises(RuntimeError, match="already published"):
132+
with pytest.raises(RuntimeError, match="already under staging directory"):
133133
rimport.stage_data(src, inputdata_root, staging_root)
134134

135135
def test_preserves_file_metadata(self, inputdata_root, staging_root):

0 commit comments

Comments
 (0)