Skip to content

Commit

Permalink
test: Fix expectations on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 18, 2024
1 parent 9e4eccd commit d23e14e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions integration_tests/test_webservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def assert_webservice(method, path, expected, **kwargs):
data = response.json()
data.pop("node_name")
if "message" in expected:
if sys.platform == 'win32':
expected["message"] = expected["message"].replace("\n", "\r\n")
expected["message"] = expected["message"].replace("\n", os.linesep)

assert data == expected

Expand Down Expand Up @@ -98,7 +97,7 @@ def test_project_directory_traversal_runner(webservice, method, params):
assert response.status_code == 200, f"200 != {response.status_code}"
assert data == {"status": "error"}
assert message.startswith("RunnerError: Traceback (most recent call last):"), message
assert message.endswith("scrapyd.exceptions.DirectoryTraversalError: ../p\n"), message
assert message.endswith(f"scrapyd.exceptions.DirectoryTraversalError: ../p{os.linesep}"), message


def test_daemonstatus():
Expand Down

0 comments on commit d23e14e

Please sign in to comment.