Skip to content

Commit

Permalink
fix: default ForwardingEventProcessor to use default event dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
oakbani committed Jan 23, 2020
1 parent ca81bad commit 18f951d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions optimizely/event/event_processor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Optimizely
# Copyright 2019-2020 Optimizely
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Expand Down Expand Up @@ -335,7 +335,7 @@ def __init__(self, event_dispatcher, logger=None, notification_center=None):
logger: Optional component which provides a log method to log messages. By default nothing would be logged.
notification_center: Optional instance of notification_center.NotificationCenter.
"""
self.event_dispatcher = event_dispatcher
self.event_dispatcher = event_dispatcher or default_event_dispatcher
self.logger = _logging.adapt_logger(logger or _logging.NoOpLogger())
self.notification_center = notification_center or _notification_center.NotificationCenter(self.logger)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_event_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def on_log_event(log_event):

def test_event_processor_defaults_to_default_event_dispatcher(self):
event_processor = ForwardingEventProcessor(None)
self.assertIsInstance(
self.assertEqual(
event_processor.event_dispatcher,
default_event_dispatcher
)

0 comments on commit 18f951d

Please sign in to comment.