Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/benelog_client/events/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@
ID_GS1_ORG = "https://id.gs1.org"

#: JSON-LD context of EPCIS 2.0. Belongs on the document, not on the event.
EPCIS_CONTEXT = "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld"
#:
#: The UNVERSIONED URL. GS1 publishes the context at
#: .../standards/epcis/epcis-context.jsonld; .../epcis/2.0.0/... pins a
#: snapshot we do not mean. ``schemaVersion`` next to it stays "2.0" -- that
#: is the property's value, not the context version, and GS1's own published
#: examples carry it that way too.
EPCIS_CONTEXT = "https://ref.gs1.org/standards/epcis/epcis-context.jsonld"

#: UUIDv5 namespace for the sender-side idempotency keys this library derives
#: (see :func:`idempotency_key`). Private and arbitrary, as RFC 4122 intends:
Expand Down
6 changes: 2 additions & 4 deletions tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ def test_a_pallet_holds_its_children(self) -> None:
class TestDocument:
def test_the_context_sits_on_the_document_not_the_event(self) -> None:
wrapped = document([object_event(action=cbv.OBSERVE, event_time=NOON)])
assert wrapped["@context"] == [
"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld"
]
assert wrapped["@context"] == ["https://ref.gs1.org/standards/epcis/epcis-context.jsonld"]
assert "@context" not in wrapped["epcisBody"]["eventList"][0]


Expand Down Expand Up @@ -411,7 +409,7 @@ def test_a_prefix_from_an_earlier_document_does_not_leak_into_the_next(self) ->
# canonicalises — weeks later, in production only.
with_prefix = {
"@context": [
"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld",
"https://ref.gs1.org/standards/epcis/epcis-context.jsonld",
{"ex": "https://one.example.test/ns/"},
],
"type": "EPCISDocument",
Expand Down
Loading