swh_config = '/tmp/pytest-of-jenkins/pytest-0/test_loader_svn_visit_with_eol0/loader.yml'
datadir = '/var/lib/jenkins/workspace/DLDSVN/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/loader/svn/tests/data'
tmp_path = PosixPath('/tmp/pytest-of-jenkins/pytest-0/test_loader_svn_visit_with_eol0')
def test_loader_svn_visit_with_eol_style(swh_config, datadir, tmp_path):
"""Check that a svn repo containing a versioned file with CRLF line
endings with svn:eol-style property set to 'native' (this is a
violation of svn specification as the file should have been
stored with LF line endings) can be loaded anyway.
"""
archive_name = "mediawiki-repo-r407-eol-native-crlf"
archive_path = os.path.join(datadir, f"{archive_name}.tgz")
repo_url = prepare_repository_from_archive(archive_path, archive_name, tmp_path)
loader = SvnLoader(repo_url)
assert loader.load() == {"status": "eventful"}
expected_snapshot = {
"id": MEDIAWIKI_SNAPSHOT,
"branches": {
"HEAD": {
"target": "7da4975c363101b819756d33459f30a866d01b1b",
"target_type": "revision",
}
},
}
> check_snapshot(expected_snapshot, loader.storage)
.tox/py3/lib/python3.7/site-packages/swh/loader/svn/tests/test_loader.py:382:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/loader/tests/__init__.py:139: in check_snapshot
snapshot = Snapshot.from_dict(snapshot)
.tox/py3/lib/python3.7/site-packages/swh/model/model.py:370: in from_dict
for (name, branch) in d.pop("branches").items()
.tox/py3/lib/python3.7/site-packages/swh/model/collections.py:27: in __init__
self.data = tuple(data)
.tox/py3/lib/python3.7/site-packages/swh/model/model.py:370: in <genexpr>
for (name, branch) in d.pop("branches").items()
.tox/py3/lib/python3.7/site-packages/swh/model/model.py:344: in from_dict
return cls(target=d["target"], target_type=TargetType(d["target_type"]))
<attrs generated init swh.model.model.SnapshotBranch>:6: in __init__
__attr_validator_target(self, __attr_target, self.target)
.tox/py3/lib/python3.7/site-packages/attr/_make.py:2146: in __call__
v(inst, attr, value)
.tox/py3/lib/python3.7/site-packages/attrs_strict/_type_validation.py:95: in _validator
_validate_elements(attribute, field, attribute.type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
attribute = Attribute(name='target', default=NOTHING, validator=_AndValidator(_validators=(<function type_validator.<locals>._vali...True, order=True, hash=None, init=True, metadata=mappingproxy({}), type=<class 'bytes'>, converter=None, kw_only=False)
value = '7da4975c363101b819756d33459f30a866d01b1b'
expected_type = <class 'bytes'>
def _validate_elements(attribute, value, expected_type):
if expected_type is None:
return
base_type = _get_base_type(expected_type)
if base_type == typing.Any:
return
if isinstance(base_type, (str, ForwardRef)):
# These base_types happen when you have string annotations and cannot
# be used in isinstance.
raise _StringAnnotationError()
if base_type != typing.Union and not isinstance( # type: ignore
value, base_type
):
> raise AttributeTypeError(value, attribute)
E attrs_strict._error.AttributeTypeError: target must be <class 'bytes'> (got 7da4975c363101b819756d33459f30a866d01b1b that is a <class 'str'>)
.tox/py3/lib/python3.7/site-packages/attrs_strict/_type_validation.py:120: AttributeTypeError
TEST RESULT
TEST RESULT
- Run At
- Jul 17 2020, 10:42 AM