Skip to content

Commit

Permalink
Add example in unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
crisely09 committed Jun 28, 2024
1 parent b96db08 commit 412af63
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 0 additions & 4 deletions kgforge/specializations/stores/nexus/prepare_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,10 @@ def _prepare_uri(
) -> Tuple[str, Dict]:
schema_id = schema_uri or resource._store_metadata._constrainedBy


if schema_id == service.UNCONSTRAINED_SCHEMA and not keep_unconstrained:
schema_id = None

url = _make_url(service, schema_id, resource.id)
url = Service.add_schema_and_id_to_endpoint(
service.url_resources, schema_id, resource_id=resource.id
)

rev = resource._store_metadata._rev
params = {"rev": rev}
Expand Down
1 change: 0 additions & 1 deletion kgforge/specializations/stores/nexus/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Service:

NEXUS_CONTENT_LENGTH_HEADER = "x-nxs-file-content-length"


def __init__(
self,
endpoint: str,
Expand Down
8 changes: 8 additions & 0 deletions tests/specializations/stores/test_bluebrain_nexus.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,14 @@ def test_to_resource(nexus_store, registered_building, building_jsonld, store_co
("/".join((NEXUS, "resources", BUCKET, quote_plus("_"), "{}", "tags"))),
id="tag-unconstrained",
),
pytest.param(
(Service.SHACL_SCHEMA),
(Service.SHACL_SCHEMA),
({"rev": 1}),
("/".join((NEXUS, "schemas", BUCKET, "{}"))),
("/".join((NEXUS, "schemas", BUCKET, "{}", "tags"))),
id="tag-schema",
),
],
)
def test_prepare_tag_uri(
Expand Down

0 comments on commit 412af63

Please sign in to comment.