Changeset View
Changeset View
Standalone View
Standalone View
swh/loader/svn/tests/test_loader.py
Show First 20 Lines • Show All 2,086 Lines • ▼ Show 20 Lines | def test_loader_svn_from_remote_dump_url_redirect(swh_storage, tmp_path, mocker): | ||||
class Info: | class Info: | ||||
repos_root_url = repo_redirect_url | repos_root_url = repo_redirect_url | ||||
url = repo_redirect_url | url = repo_redirect_url | ||||
mock_client().info.return_value = {"repo": Info()} | mock_client().info.return_value = {"repo": Info()} | ||||
# init remote dump loader and mock some methods | # init remote dump loader and mock some methods | ||||
loader = SvnLoaderFromRemoteDump(swh_storage, repo_url, temp_directory=tmp_path) | loader = SvnLoaderFromRemoteDump(swh_storage, repo_url, temp_directory=tmp_path) | ||||
loader.dump_svn_revisions = mocker.MagicMock() | loader.dump_svn_revisions = mocker.MagicMock(return_value=("", -1)) | ||||
loader.start_from = mocker.MagicMock(return_value=(0, 0)) | loader.start_from = mocker.MagicMock(return_value=(0, 0)) | ||||
# prepare loading | # prepare loading | ||||
loader.prepare() | loader.prepare() | ||||
# check redirection URL has been used to dump repository | # check redirection URL has been used to dump repository | ||||
assert loader.dump_svn_revisions.call_args_list[0][0][0] == repo_redirect_url | assert loader.dump_svn_revisions.call_args_list[0][0][0] == repo_redirect_url | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |