Skip to content
Snippets Groups Projects
Commit 167f7b85 authored by martinRenou's avatar martinRenou
Browse files

Create probe classes for the notification listeners

parent 9e5426d1
No related branches found
No related tags found
1 merge request!101Create probe classes for tests
......@@ -5,6 +5,7 @@ from force_bdss.factory_registry_plugin import FactoryRegistryPlugin
from .mco import ProbeMCOFactory
from .kpi_calculator import ProbeKPICalculatorFactory
from .data_source import ProbeDataSourceFactory
from .notification_listener import ProbeNotificationListenerFactory
class ProbeFactoryRegistryPlugin(FactoryRegistryPlugin):
......@@ -21,3 +22,6 @@ class ProbeFactoryRegistryPlugin(FactoryRegistryPlugin):
def _data_source_factories_default(self):
return [ProbeDataSourceFactory(self)]
def _notification_listener_factories_default(self):
return [ProbeNotificationListenerFactory(self)]
from traits.api import Bool, Str, Type
from force_bdss.api import (
BaseNotificationListener, BaseNotificationListenerModel,
BaseNotificationListenerFactory)
class ProbeNotificationListener(BaseNotificationListener):
initialize_called = Bool(False)
deliver_called = Bool(False)
finalize_called = Bool(False)
def initialize(self, model):
self.initialize_called = True
def deliver(self, event):
self.deliver_called = True
def finalize(self):
self.finalize_called = True
class ProbeNotificationListenerModel(BaseNotificationListenerModel):
pass
class ProbeNotificationListenerFactory(BaseNotificationListenerFactory):
id = Str("enthought.test.notification_listener")
name = "test_notification_listener"
model_class = Type(ProbeNotificationListenerModel)
listener_class = Type(ProbeNotificationListener)
def create_listener(self):
return self.listener_class(self)
def create_model(self, model_data=None):
return self.model_class(self, model_data=model_data)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment