Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
force-bdss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adham Hashibon
force-bdss
Commits
167f7b85
Commit
167f7b85
authored
7 years ago
by
martinRenou
Browse files
Options
Downloads
Patches
Plain Diff
Create probe classes for the notification listeners
parent
9e5426d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!101
Create probe classes for tests
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
force_bdss/tests/probe_classes/factory_registry_plugin.py
+4
-0
4 additions, 0 deletions
force_bdss/tests/probe_classes/factory_registry_plugin.py
force_bdss/tests/probe_classes/notification_listener.py
+39
-0
39 additions, 0 deletions
force_bdss/tests/probe_classes/notification_listener.py
with
43 additions
and
0 deletions
force_bdss/tests/probe_classes/factory_registry_plugin.py
+
4
−
0
View file @
167f7b85
...
...
@@ -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
)]
This diff is collapsed.
Click to expand it.
force_bdss/tests/probe_classes/notification_listener.py
0 → 100644
+
39
−
0
View file @
167f7b85
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment