Skip to content

Commit 2da7159

Browse files
committed
test(sync[svn]) Add eample for non-empty repo checkout
1 parent 5fa09ee commit 2da7159

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

tests/sync/test_svn.py

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,26 @@
1212
pytestmark = pytest.mark.skip(reason="svn is not available")
1313

1414

15-
def test_svn_sync(
16-
tmp_path: pathlib.Path,
17-
svn_remote_repo_with_files: pathlib.Path,
15+
def test_svn_sync(tmp_path: pathlib.Path, svn_remote_repo: pathlib.Path) -> None:
16+
"""Tests for SvnSync."""
17+
repo_name = "my_svn_project"
18+
19+
svn_repo = SvnSync(
20+
url=f"file://{svn_remote_repo}",
21+
path=str(tmp_path / repo_name),
22+
)
23+
24+
svn_repo.obtain()
25+
svn_repo.update_repo()
26+
27+
assert svn_repo.get_revision() == 0
28+
assert svn_repo.get_revision_file("./") == 0
29+
30+
assert (tmp_path / repo_name).exists()
31+
32+
33+
def test_svn_sync_with_files(
34+
tmp_path: pathlib.Path, svn_remote_repo_with_files: pathlib.Path
1835
) -> None:
1936
"""Tests for SvnSync."""
2037
repo_name = "my_svn_project"
@@ -28,7 +45,7 @@ def test_svn_sync(
2845
svn_repo.update_repo()
2946

3047
assert svn_repo.get_revision() == 0
31-
assert svn_repo.get_revision_file("./") == 0
48+
assert svn_repo.get_revision_file("./") == 3
3249

3350
assert (tmp_path / repo_name).exists()
3451

0 commit comments

Comments
 (0)