Skip to content

Commit 911928b

Browse files
committed
Minor formatting changes
1 parent a5285cd commit 911928b

3 files changed

Lines changed: 24 additions & 8 deletions

File tree

dfetch/vcs/archive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def check_zip_members(zf: zipfile.ZipFile) -> list[zipfile.ZipInfo]:
368368

369369
@staticmethod
370370
def _is_unsafe_symlink_target(target: str) -> bool:
371-
"""Return *True* when *target* is an unsafe symlink destination.
371+
r"""Return *True* when *target* is an unsafe symlink destination.
372372
373373
A target is unsafe if it is absolute or contains ``..`` components
374374
under either POSIX or Windows path semantics, so that backslash-based

tests/test_manifest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,13 @@ def test_get_manifest_location(name, manifest, project_name, result) -> None:
225225

226226
@pytest.mark.parametrize(
227227
"dst",
228-
["/etc/passwd", "/tmp/evil", "C:/Windows/System32", "C:\\Windows\\System32", "\\temp\\evil"],
228+
[
229+
"/etc/passwd",
230+
"/tmp/evil",
231+
"C:/Windows/System32",
232+
"C:\\Windows\\System32",
233+
"\\temp\\evil",
234+
],
229235
)
230236
def test_validate_destination_rejects_absolute_paths(dst) -> None:
231237
with pytest.raises(ValueError, match="absolute"):

tests/test_svn_vcs.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""Unit tests for SvnRepo.export() argument safety."""
22

3-
import pytest
43
from unittest.mock import patch
54

5+
import pytest
6+
67
from dfetch.vcs.svn import SvnRepo
78

89

@@ -11,9 +12,14 @@ def test_export_with_revision_passes_correct_args():
1112
with patch("dfetch.vcs.svn.run_on_cmdline") as mock_run:
1213
SvnRepo.export("svn://example.com/repo", rev="12345", dst="/tmp/out")
1314
assert mock_run.call_args[0][1] == [
14-
"svn", "export", "--non-interactive", "--force",
15-
"--revision", "12345",
16-
"svn://example.com/repo", "/tmp/out",
15+
"svn",
16+
"export",
17+
"--non-interactive",
18+
"--force",
19+
"--revision",
20+
"12345",
21+
"svn://example.com/repo",
22+
"/tmp/out",
1723
]
1824

1925

@@ -22,8 +28,12 @@ def test_export_without_revision_omits_revision_args():
2228
with patch("dfetch.vcs.svn.run_on_cmdline") as mock_run:
2329
SvnRepo.export("svn://example.com/repo", dst="/tmp/out")
2430
assert mock_run.call_args[0][1] == [
25-
"svn", "export", "--non-interactive", "--force",
26-
"svn://example.com/repo", "/tmp/out",
31+
"svn",
32+
"export",
33+
"--non-interactive",
34+
"--force",
35+
"svn://example.com/repo",
36+
"/tmp/out",
2737
]
2838

2939

0 commit comments

Comments
 (0)