Skip to content

Commit

Permalink
Fix tests for Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Carmen Bianca BAKKER <[email protected]>
  • Loading branch information
carmenbianca committed Oct 10, 2024
1 parent ede3368 commit 850d438
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/reuse/cli/annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@ def verify_paths_line_handling(
_(
"'{path}' does not support single-line comments, please"
" do not use --single-line"
).format(path=path)
).format(path=path.as_posix())
)
if multi_line and not style.can_handle_multi():
raise click.UsageError(
_(
"'{path}' does not support multi-line comments, please"
" do not use --multi-line"
).format(path=path)
).format(path=path.as_posix())
)


Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli_annotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import stat
from inspect import cleandoc
from pathlib import PurePath

import pytest
from click.testing import CliRunner
Expand Down Expand Up @@ -1524,7 +1525,7 @@ def test_exit_if_unrecognised(self, fake_repository, mock_date_today):
"The following files do not have a recognised file extension"
in result.output
)
assert "baz/bar.unknown" in result.output
assert str(PurePath("baz/bar.unknown")) in result.output
assert "foo.py" not in result.output
assert "Jane Doe" not in (fake_repository / "baz/foo.py").read_text()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_simple(self, empty_directory, mock_put_license_in_file):

assert result.exit_code == 0
mock_put_license_in_file.assert_called_with(
"0BSD", Path("LICENSES/0BSD.txt").resolve(), source=None
"0BSD", Path(os.path.realpath("LICENSES/0BSD.txt")), source=None
)

def test_all_and_license_mutually_exclusive(self, empty_directory):
Expand Down

0 comments on commit 850d438

Please sign in to comment.