Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/tests/test_loader.py
Show First 20 Lines • Show All 2,166 Lines • ▼ Show 20 Lines | ): | ||||
assert_last_visit_matches( | assert_last_visit_matches( | ||||
loader.storage, | loader.storage, | ||||
repo_url, | repo_url, | ||||
status="full", | status="full", | ||||
type="svn", | type="svn", | ||||
) | ) | ||||
check_snapshot(loader.snapshot, loader.storage) | check_snapshot(loader.snapshot, loader.storage) | ||||
def test_loader_with_spaces_in_svn_url(swh_storage, repo_url, tmp_path): | |||||
filename = "file with spaces.txt" | |||||
content = b"foo" | |||||
add_commit( | |||||
repo_url, | |||||
"Add file with spaces in its name", | |||||
[ | |||||
CommitChange( | |||||
change_type=CommitChangeType.AddOrUpdate, | |||||
path=filename, | |||||
data=content, | |||||
), | |||||
], | |||||
) | |||||
svnrepo = SvnRepo(repo_url, repo_url, tmp_path, max_content_length=10000) | |||||
dest_path = f"{tmp_path}/file" | |||||
svnrepo.export(f"{repo_url}/{filename}", to=dest_path) | |||||
with open(dest_path, "rb") as f: | |||||
assert f.read() == content |