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 d23e14e commit 0d5d66c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/test_environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_get_environment_secure(self):

self.assertEqual(
str(exc.value),
f"{v if k == '_project' else 'mybot'}/"
f"{v if k == '_spider' else 'myspider'}/"
f"{v if k == '_project' else 'mybot'}{os.sep}"
f"{v if k == '_spider' else 'myspider'}{os.sep}"
f"{v if k == '_job' else 'ID'}.log"
)
3 changes: 2 additions & 1 deletion tests/test_webservice.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from pathlib import Path
from unittest import mock

Expand Down Expand Up @@ -206,7 +207,7 @@ def test_bad_project_names_runner(self, txrequest, site_no_egg, endpoint, attach
getattr(site_no_egg.children[endpoint], method)(txrequest)

assert str(exc.value).startswith("Traceback (most recent call last):"), str(exc.value)
assert str(exc.value).endswith("scrapyd.exceptions.DirectoryTraversalError: ../p\n"), str(exc.value)
assert str(exc.value).endswith(f"scrapyd.exceptions.DirectoryTraversalError: ../p{os.linesep}"), str(exc.value)

storage = site_no_egg.app.getComponent(IEggStorage)
version, egg = storage.get('quotesbot')
Expand Down

0 comments on commit 0d5d66c

Please sign in to comment.