From b991f04fb8875dda0bafa9a72f39f502d0fe1d1b Mon Sep 17 00:00:00 2001 From: Navin Karkera Date: Mon, 24 Jul 2023 15:46:09 +0200 Subject: [PATCH] fix: Update openedx_events/apps.py Co-authored-by: Arunmozhi --- openedx_events/apps.py | 2 +- openedx_events/tests/test_producer_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/openedx_events/apps.py b/openedx_events/apps.py index 77ac9618..b70cbd99 100644 --- a/openedx_events/apps.py +++ b/openedx_events/apps.py @@ -41,7 +41,7 @@ def _ensure_signal_config_format(self, event_type, configurations): Raises: ProducerConfigurationError: If configuration is not valid. """ - if type(configurations) not in (list, tuple): + if not isinstance(configurations, list) and not isinstance(configurations, tuple): raise ProducerConfigurationError( event_type=event_type, message="Configuration for event_types should be a list or a tuple of dictionaries" diff --git a/openedx_events/tests/test_producer_config.py b/openedx_events/tests/test_producer_config.py index bc1ab9d6..a0b389bd 100644 --- a/openedx_events/tests/test_producer_config.py +++ b/openedx_events/tests/test_producer_config.py @@ -79,7 +79,7 @@ def test_configuration_is_validated(self): apps.get_app_config("openedx_events").ready() with override_settings(EVENT_BUS_PRODUCER_CONFIG={"type": ""}): - with pytest.raises(ProducerConfigurationError, match="should be list or tuple"): + with pytest.raises(ProducerConfigurationError, match="should be a list or a tuple"): apps.get_app_config("openedx_events").ready() with override_settings(EVENT_BUS_PRODUCER_CONFIG={"type": [""]}):