Skip to content

Commit c6daee2

Browse files
Lucas-FManagertoddbaert
authored andcommitted
test: cover event dispatch noop path
Signed-off-by: Lucas-FManager <265058144+Lucas-FManager@users.noreply.github.com>
1 parent 53a663a commit c6daee2

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/test_client.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import pytest
1010

11-
from openfeature import api
11+
from openfeature import _event_support, api
1212
from openfeature.api import (
1313
add_hooks,
1414
clear_hooks,
@@ -543,6 +543,21 @@ def test_provider_event_late_binding():
543543
spy.provider_configuration_changed.assert_called_once_with(details)
544544

545545

546+
def test_run_client_handlers_without_registered_handlers_is_noop():
547+
provider = NoOpProvider()
548+
set_provider(provider)
549+
client = get_client("client-without-handlers")
550+
details = EventDetails(provider_name=provider.get_metadata().name)
551+
552+
assert client not in _event_support._client_handlers
553+
554+
_event_support.run_client_handlers(
555+
client, ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, details
556+
)
557+
558+
assert client not in _event_support._client_handlers
559+
560+
546561
# Requirement 5.1.4, Requirement 5.1.5
547562
def test_provider_event_handler_exception():
548563
# Given

0 commit comments

Comments
 (0)