Page MenuHomeSoftware Heritage

Jenkins > .tox.py3.lib.python3.7.site-packages.swh.storage.tests.test_postgresql.TestStorage::test_content_metadata_get_after
Failed

TEST RESULT

Run At
Oct 7 2021, 11:27 AM
Details
self = <swh.storage.tests.test_postgresql.TestStorage object at 0x7f7a1b62d0b8> swh_storage = <swh.storage.postgresql.storage.Storage object at 0x7f7a1b62d0f0> sample_data = <swh.storage.tests.storage_data.StorageData object at 0x7f7a1b62d1d0> def test_content_metadata_get_after(self, swh_storage, sample_data): content = sample_data.content fetcher = sample_data.metadata_fetcher authority = sample_data.metadata_authority content_metadata, content_metadata2 = sample_data.content_metadata[:2] swh_storage.metadata_fetcher_add([fetcher]) swh_storage.metadata_authority_add([authority]) swh_storage.raw_extrinsic_metadata_add([content_metadata, content_metadata2]) result = swh_storage.raw_extrinsic_metadata_get( content.swhid().to_extended(), authority, > after=content_metadata.discovery_date - timedelta(seconds=1), ) .tox/py3/lib/python3.7/site-packages/swh/storage/tests/storage_tests.py:4173: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ .tox/py3/lib/python3.7/site-packages/swh/core/db/common.py:62: in _meth return meth(self, *args, db=db, cur=cur, **kwargs) .tox/py3/lib/python3.7/site-packages/swh/storage/postgresql/storage.py:1465: in raw_extrinsic_metadata_get results.append(converters.db_to_raw_extrinsic_metadata(row)) .tox/py3/lib/python3.7/site-packages/swh/storage/postgresql/converters.py:326: in db_to_raw_extrinsic_metadata directory=map_optional(CoreSWHID.from_string, row["directory"]), <attrs generated init swh.model.model.RawExtrinsicMetadata>:18: in __init__ __attr_validator_target(self, __attr_target, self.target) .tox/py3/lib/python3.7/site-packages/attrs_strict/_type_validation.py:105: in _validator _validate_elements(attribute, field, attribute.type) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ attribute = Attribute(name='target', default=NOTHING, validator=<function type_validator.<locals>._validator at 0x7f7c538318c8>, r...xy({}), type=<class 'swh.model.swhids.ExtendedSWHID'>, converter=None, kw_only=False, inherited=False, on_setattr=None) value = 'swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd' expected_type = <class 'swh.model.swhids.ExtendedSWHID'> 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() elif base_type == Literal or base_type == type(Literal): # type: ignore _handle_literal(attribute, value, expected_type) elif base_type == typing.Union: # type: ignore _handle_union(attribute, value, expected_type) elif not isinstance(value, base_type): > raise AttributeTypeError(value, attribute) E attrs_strict._error.AttributeTypeError: target must be <class 'swh.model.swhids.ExtendedSWHID'> (got swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd that is a <class 'str'>) .tox/py3/lib/python3.7/site-packages/attrs_strict/_type_validation.py:131: AttributeTypeError