def test_build_swh_revision_default():
"""This should build the swh revision with the swh revision's extra
headers about the repository.
"""
dir_id = hash_to_bytes("d6e08e19159f77983242877c373c75222d5ae9dd")
date = TimestampWithTimezone(
timestamp=Timestamp(seconds=1088108379, microseconds=0),
offset=0,
negative_utc=False,
)
actual_rev = converters.build_swh_revision(
repo_uuid=b"uuid",
dir_id=dir_id,
commit={
"author_name": Person(
name=b"theo", email=b"theo@uuid", fullname=b"theo <theo@uuid>"
),
"message": b"commit message",
"author_date": date,
},
rev=10,
> parents=[],
)
.tox/py3/lib/python3.7/site-packages/swh/loader/svn/tests/test_converters.py:65:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/loader/svn/converters.py:83: in build_swh_revision
parents=parents,
<attrs generated init swh.model.model.Revision>:24: in __init__
__attr_validator_parents(self, __attr_parents, self.parents)
.tox/py3/lib/python3.7/site-packages/attrs_strict/_type_validation.py:63: in _validator
_validate_elements(attribute, field, attribute.type)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
attribute = Attribute(name='parents', default=(), validator=<function type_validator.<locals>._validator at 0x7f9365564ea0>, repr=...er=True, hash=None, init=True, metadata=mappingproxy({}), type=typing.Tuple[bytes, ...], converter=None, kw_only=False)
value = [], expected_type = typing.Tuple[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 base_type != typing.Union and not isinstance( # type: ignore
value, base_type
):
> raise AttributeTypeError(value, attribute)
E attrs_strict._error.AttributeTypeError: parents must be typing.Tuple[bytes, ...] (got [] that is a <class 'list'>)
.tox/py3/lib/python3.7/site-packages/attrs_strict/_type_validation.py:80: AttributeTypeError
TEST RESULT
TEST RESULT
- Run At
- Jun 4 2020, 2:48 PM