Skip to content

Commit

Permalink
tests: fix runner and data model
Browse files Browse the repository at this point in the history
  • Loading branch information
M3nin0 committed Aug 30, 2024
1 parent 5db720c commit 0ab4e38
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ tests =
pytest-lazy-fixture>=0.6.3
sphinx>=4.5.0
tripoli~=2.0.0
docker-services-cli<=0.7.1
opensearch2 =
invenio-search[opensearch2]>=2.1.0,<3.0.0

Expand Down
37 changes: 35 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,39 @@ def minimal_record():
}


@pytest.fixture(scope="module")
def minimal_record_marketplace():
"""Minimal record data as dict coming from the external world."""
return {
"pids": {},
"access": {
"record": "public",
"files": "public",
},
"files": {
"enabled": False, # Most tests don't care about files
},
"metadata": {
"publication_date": "2020-06-01",
"resource_type": {"id": "image-photo"},
"creators": [
{
"person_or_org": {
"family_name": "Brown",
"given_name": "Troy",
"type": "personal",
}
}
],
"title": "A Romans story",
"marketplace": {
"launch_url": "https://test.com",
"vendor_contact": "email@test.com",
},
},
}


@pytest.fixture(scope="module")
def record_resource_simple(
location, resource_type_v, authenticated_identity, minimal_record
Expand Down Expand Up @@ -325,11 +358,11 @@ def record_package_simple(

@pytest.fixture(scope="module")
def record_marketplace_item_simple(
location, resource_type_v, authenticated_identity, minimal_record
location, resource_type_v, authenticated_identity, minimal_record_marketplace
):
"""Basic Package Record."""
record_item = current_marketplace_service.create(
authenticated_identity, minimal_record
authenticated_identity, minimal_record_marketplace
)
record_item = current_marketplace_service.publish(
authenticated_identity, record_item["id"]
Expand Down

0 comments on commit 0ab4e38

Please sign in to comment.