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 0x7f78850d3748>
clearcode_dsn = "dbname=clearcode user=postgres host=127.0.0.1 port=17881 options=''"
datadir = '/var/lib/jenkins/workspace/DMFCD/tests-on-diff/.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/tests/data'
def test_orchestrator(swh_storage, clearcode_dsn, datadir):
connection = psycopg2.connect(dsn=clearcode_dsn)
cursor = connection.cursor()
add_content_data(swh_storage)
# Fill data in clearcode database, for first time orchestration
fill_data_before_updation_of_storage(
connection=connection, cursor=cursor, datadir=datadir
)
> orchestrator(storage=swh_storage, clearcode_dsn=clearcode_dsn)
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/tests/test_orchestrator.py:148:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/orchestrator.py:227: in orchestrator
storage=storage, cursor=cursor, connection=connection, date=date
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/orchestrator.py:211: in read_from_clearcode_and_write_in_swh
row=Row(path=row[0], metadata=row[1], date=row[2]),
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/orchestrator.py:107: in orchestrate_row
metadata=row.metadata, id=row.path, date=row.date, storage=storage
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/mapping_utils.py:346: in map_row
date=date,
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/mapping_utils.py:222: in map_harvest
map_sha1_and_add_in_data(storage, sha1, data, file, date, format_)
.tox/py3/lib/python3.7/site-packages/swh/clearlydefined/mapping_utils.py:133: in map_sha1_and_add_in_data
swhid = map_sha1_with_swhid(storage=storage, sha1=sha1)
.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