swh_storage = <swh.storage.proxies.filter.FilteringProxyStorage object at 0x7eff2e72fe80>
mocker = <pytest_mock.plugin.MockerFixture object at 0x7eff2e6260b8>
tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_loader_first_revision_is_0')
def test_loader_first_revision_is_not_number_one(swh_storage, mocker, tmp_path):
class SvnRepoSkipFirstRevision(SvnRepo):
def logs(self, revision_start, revision_end):
"""Overrides logs method to skip revision number one in yielded revisions"""
yield from super().logs(revision_start + 1, revision_end)
from swh.loader.svn import loader
mocker.patch.object(loader, "SvnRepo", SvnRepoSkipFirstRevision)
# create a repository
repo_path = os.path.join(tmp_path, "tmprepo")
repos.create(repo_path)
repo_url = f"file://{repo_path}"
for filename in ("foo", "bar", "baz"):
add_commit(
repo_url,
f"Add {filename} file",
[
CommitChange(
change_type=CommitChangeType.AddOrUpdate,
path=filename,
data=f"{filename}\n".encode(),
)
],
)
loader = SvnLoader(swh_storage, repo_url, destination_path=tmp_path)
> assert loader.load() == {"status": "eventful"}
E AssertionError: assert {'status': 'failed'} == {'status': 'eventful'}
E Differing items:
E {'status': 'failed'} != {'status': 'eventful'}
E Full diff:
E - {'status': 'eventful'}
E + {'status': 'failed'}
.tox/py3/lib/python3.7/site-packages/swh/loader/svn/tests/test_loader.py:1170: AssertionError
TEST RESULT
TEST RESULT
- Run At
- Nov 8 2021, 4:52 PM