ValueError: <ObjectType.CONTENT: 'cnt'> is not a valid ExtendedObjectType
During handling of the above exception, another exception occurred:
swh_storage = <swh.storage.postgresql.storage.Storage object at 0x7f788540a390>
def test_mapping_sha1_with_swhID(swh_storage):
add_content_data(swh_storage)
sha1 = "34973274ccef6ab4dfaaf86599792fa9c3fe4689"
> assert "swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd" == map_sha1_with_swhid(
sha1=sha1, storage=swh_storage
)
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/tests/test_mapping_utils.py:159:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/mapping_utils.py:100: in map_sha1_with_swhid
return ExtendedSWHID(object_type=ObjectType.CONTENT, object_id=content.sha1_git)
<attrs generated init swh.model.identifiers.ExtendedSWHID>:7: in __init__
_inst_dict['object_type'] = __attr_converter_object_type(object_type)
/usr/lib/python3.7/enum.py:310: in __call__
return cls.__new__(cls, value)
/usr/lib/python3.7/enum.py:564: in __new__
raise exc
/usr/lib/python3.7/enum.py:548: in __new__
result = cls._missing_(value)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
cls = <enum 'ExtendedObjectType'>, value = <ObjectType.CONTENT: 'cnt'>
@classmethod
def _missing_(cls, value):
> raise ValueError("%r is not a valid %s" % (value, cls.__name__))
E ValueError: <ObjectType.CONTENT: 'cnt'> is not a valid ExtendedObjectType
/usr/lib/python3.7/enum.py:577: ValueError
TEST RESULT
TEST RESULT
- Run At
- Mar 5 2021, 9:35 AM