diff --git a/README.rst b/README.rst index 7b4bbc3..47c762b 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ Features -------- * easily plug event handling scripts for all Orthanc's `change events`_ - * chain functions into a pipeline (composition) -* run asyncio functions (coroutines) for concurrent processing of a change event +* run asyncio functions (coroutines) for concurrent processing of change events * run (integration) tests for your Orthanc python scripts * publish events to Kafka, RabbitMQ and NATS @@ -54,7 +54,7 @@ Httpx was chosen as a base library to access the Orthanc API, rather than orthan developer friendly, and external API access avoids deadlocks in the Python plugin (before this was solved in 3.1). -Running +Getting Started ------- ``entry_point.py`` provides the first boilerplate to get started. Run it by issuing diff --git a/docs/usage.rst b/docs/usage.rst index bc58272..b7956d0 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -14,7 +14,7 @@ specified in orthanc.json or as an environment variable for the Osimis docker im logging.warn(evt.resource_id) event_dispatcher.register_event_handlers({orthanc.ChangeType.STABLE_STUDY: log_event}, orthanc_module=orthanc, - session=event_dispatcher.create_session(orthanc)) + sync_client=event_dispatcher.create_session(orthanc)) To unit test the log_event handler with pytest, use:: @@ -26,7 +26,7 @@ To unit test the log_event handler with pytest, use:: assert 'resource-uuid' in caplog.text -One can use the excellent responses_ library to stub the API responses. +One can use the excellent respx_ library to stub the API responses. To integration test a handler, use:: @@ -53,4 +53,4 @@ To integration test a handler, use:: The event_dispatcher will ensure that your API call will work the same when called from the Orthanc Python plugin. For more examples, see the tests/ directory in the Git repository. -.. _responses: https://github.com/getsentry/responses +.. respx: https://lundberg.github.io/respx/ diff --git a/tests/test_event_dispatcher.py b/tests/test_event_dispatcher.py index 585001b..6b5c4ab 100644 --- a/tests/test_event_dispatcher.py +++ b/tests/test_event_dispatcher.py @@ -5,8 +5,8 @@ from functools import partial import httpx -import respx import pytest +import respx from orthanc_ext import event_dispatcher from orthanc_ext.http_utilities import create_internal_client, ClientType