Skip to content

Commit 66415ec

Browse files
authored
OP#10321: Expect the separator the platform actually writes
The message renders paths with str(Path), so on Windows the separator is a backslash. Deriving the expectation from the same Path objects keeps the test green on every runner.
1 parent d9e7568 commit 66415ec

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎tests/unit/OTAnalytics/adapter_ui/test_dummy_viewmodel_otconfig.py‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,19 +152,20 @@ def test_names_what_was_asked_for_and_what_was_used(self) -> None:
152152
"""
153153
given = create_given()
154154
target = create_target(given)
155+
requested = Path("moved/clip.ottrk")
156+
used = Path("here/clip.ottrk")
155157

156158
target.report_substituted_files(
157-
[
158-
SubstitutedFile(
159-
requested=Path("moved/clip.ottrk"), used=Path("here/clip.ottrk")
160-
)
161-
]
159+
[SubstitutedFile(requested=requested, used=used)]
162160
)
163161

164162
reported = reported_messages(given)
165163
assert len(reported) == 1
166-
assert "moved/clip.ottrk" in reported[0]
167-
assert "here/clip.ottrk" in reported[0]
164+
# The paths are rendered the way the platform writes them, so the
165+
# expectation has to come from the same Path objects: on Windows the
166+
# separator is a backslash.
167+
assert str(requested) in reported[0]
168+
assert str(used) in reported[0]
168169

169170
def test_reports_every_substitution_in_one_message(self) -> None:
170171
"""A project with many rebound files must not raise many boxes.

0 commit comments

Comments
 (0)