Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tests/test_bink_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ def walk(path, onerror=None):
with mock.patch.object(names_mod.os, "walk", walk), \
contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()) as err:
self.assertEqual(names_mod.main([source, "--mount", mount, "--out", report]), 1)
self.assertIn(blocked, err.getvalue())
# OSError's own message prints the filename with %r, so on Windows every backslash is doubled:
# compare the repr, which is what the tool prints, not the raw path.
self.assertIn(repr(blocked), err.getvalue())
with open(report, "rb") as f:
self.assertEqual(f.read(), b"previous report")

Expand Down
4 changes: 3 additions & 1 deletion tests/test_opus_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,9 @@ def walk(path, onerror=None):

with mock.patch.object(T.os, "walk", walk), contextlib.redirect_stderr(io.StringIO()) as err:
self.assertEqual(T.main([root, "--names", names, "--dry-run"]), 2)
self.assertIn(blocked, err.getvalue())
# OSError's own message prints the filename with %r, so on Windows every backslash is doubled:
# compare the repr, which is what the tool prints, not the raw path.
self.assertIn(repr(blocked), err.getvalue())

def test_cli(self):
r = subprocess.run([sys.executable, "-I", TOOL, self.opus, "--names", self.names, "--source", "story",
Expand Down
4 changes: 3 additions & 1 deletion tests/test_world_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def walk(root, onerror=None):
with mock.patch.object(WN.os, "walk", walk), contextlib.redirect_stderr(io.StringIO()) as err, \
contextlib.redirect_stdout(io.StringIO()):
self.assertEqual(WN.main(["build", "--manifest", manifests, "--names", names, "--out", output]), 1)
self.assertIn(blocked, err.getvalue())
# OSError's own message prints the filename with %r, so on Windows every backslash is doubled:
# compare the repr, which is what the tool prints, not the raw path.
self.assertIn(repr(blocked), err.getvalue())
with open(output, "rb") as f:
self.assertEqual(f.read(), b"existing dictionary")

Expand Down
Loading