diff --git a/arkindex_worker/worker/entity.py b/arkindex_worker/worker/entity.py index e42036e17e8b98660a8b5ef3e0f84d98ee6e44da..30c1637d82037ec0cd72e0cf27e0de3d29000e19 100644 --- a/arkindex_worker/worker/entity.py +++ b/arkindex_worker/worker/entity.py @@ -18,7 +18,9 @@ class EntityType(Enum): class EntityMixin(object): - def create_entity(self, element, name, type, corpus, metas=None, validated=None): + def create_entity( + self, element, name, type, corpus=None, metas=None, validated=None + ): """ Create an entity on the given corpus through API Return the ID of the created entity diff --git a/tests/test_elements_worker/test_entities.py b/tests/test_elements_worker/test_entities.py index 540635def31136871be3ac9aba9982e83ea282ca..1fe38b36ba4fc983f09f3a4c813112d666767df7 100644 --- a/tests/test_elements_worker/test_entities.py +++ b/tests/test_elements_worker/test_entities.py @@ -90,14 +90,13 @@ def test_create_entity_wrong_type(mock_elements_worker): def test_create_entity_wrong_corpus(monkeypatch, mock_elements_worker): elt = Element({"id": "12341234-1234-1234-1234-123412341234"}) - # Triggering an error on metas param, giving corpus=None should work since + # Triggering an error on metas param, not giving corpus should work since # ARKINDEX_CORPUS_ID environment variable is set on mock_elements_worker with pytest.raises(AssertionError) as e: mock_elements_worker.create_entity( element=elt, name="Bob Bob", type=EntityType.Person, - corpus=None, metas="wrong metas", ) assert str(e.value) == "metas should be of type dict"