Changeset View
Changeset View
Standalone View
Standalone View
swh/provenance/tests/test_routing_keys.py
# Copyright (C) 2021 The Software Heritage developers | # Copyright (C) 2021-2022 The Software Heritage developers | ||||
# See the AUTHORS file at the top-level directory of this distribution | # See the AUTHORS file at the top-level directory of this distribution | ||||
# License: GNU General Public License version 3, or any later version | # License: GNU General Public License version 3, or any later version | ||||
# See top-level LICENSE file for more information | # See top-level LICENSE file for more information | ||||
import pytest | import pytest | ||||
from swh.model.hashutil import hash_to_bytes | from swh.model.hashutil import hash_to_bytes | ||||
from swh.provenance.api.server import ProvenanceStorageRabbitMQServer | from swh.provenance.storage.interface import RelationType | ||||
from swh.provenance.interface import RelationType | from swh.provenance.storage.rabbitmq.server import ProvenanceStorageRabbitMQServer | ||||
def test_routing_keys_for_entity() -> None: | def test_routing_keys_for_entity() -> None: | ||||
assert ( | assert ( | ||||
ProvenanceStorageRabbitMQServer.get_routing_key( | ProvenanceStorageRabbitMQServer.get_routing_key( | ||||
hash_to_bytes("c0d8929936631ecbcf9147be6b8aa13b13b014e4"), | hash_to_bytes("c0d8929936631ecbcf9147be6b8aa13b13b014e4"), | ||||
"content_add", | "content_add", | ||||
None, | None, | ||||
▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines |