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
d57d8007
Commit
d57d8007
authored
6 years ago
by
Stefano Borini
Browse files
Options
Downloads
Patches
Plain Diff
Fixed remaining probe classes
parent
7db726d0
No related branches found
No related tags found
1 merge request
!130
Safer plugin import - 2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
force_bdss/tests/probe_classes/notification_listener.py
+13
-14
13 additions, 14 deletions
force_bdss/tests/probe_classes/notification_listener.py
force_bdss/tests/probe_classes/ui_hooks.py
+8
-6
8 additions, 6 deletions
force_bdss/tests/probe_classes/ui_hooks.py
with
21 additions
and
20 deletions
force_bdss/tests/probe_classes/notification_listener.py
+
13
−
14
View file @
d57d8007
from
traits.api
import
Bool
,
Str
,
Type
,
Function
,
Any
from
traits.api
import
Bool
,
Function
,
Any
from
force_bdss.ids
import
factory_id
from
force_bdss.api
import
(
BaseNotificationListener
,
BaseNotificationListenerModel
,
BaseNotificationListenerFactory
)
...
...
@@ -43,25 +42,25 @@ class ProbeNotificationListenerModel(BaseNotificationListenerModel):
class
ProbeNotificationListenerFactory
(
BaseNotificationListenerFactory
):
id
=
Str
(
factory_id
(
"
enthought
"
,
"
test_nl
"
))
name
=
"
test_notification_listener
"
model_class
=
Type
(
ProbeNotificationListenerModel
)
listener_class
=
Type
(
ProbeNotificationListener
)
initialize_function
=
Function
(
default_value
=
pass_function
)
deliver_function
=
Function
(
default_value
=
pass_function
)
finalize_function
=
Function
(
default_value
=
pass_function
)
def
get_name
(
self
):
return
"
test_notification_listener
"
def
get_identifier
(
self
):
return
"
test_nl
"
def
get_listener_class
(
self
):
return
ProbeNotificationListener
def
get_model_class
(
self
):
return
ProbeNotificationListenerModel
def
create_listener
(
self
):
return
self
.
listener_class
(
self
,
initialize_function
=
self
.
initialize_function
,
deliver_function
=
self
.
deliver_function
,
finalize_function
=
self
.
finalize_function
)
def
create_model
(
self
,
model_data
=
None
):
if
model_data
is
None
:
model_data
=
{}
return
self
.
model_class
(
self
,
**
model_data
)
This diff is collapsed.
Click to expand it.
force_bdss/tests/probe_classes/ui_hooks.py
+
8
−
6
View file @
d57d8007
...
...
@@ -38,15 +38,17 @@ class ProbeUIHooksManager(BaseUIHooksManager):
class
ProbeUIHooksFactory
(
BaseUIHooksFactory
):
create_ui_hooks_manager_raises
=
Bool
()
def
__init__
(
self
,
plugin
=
None
,
*
args
,
**
kwargs
):
if
plugin
is
None
:
plugin
=
mock
.
Mock
(
Plugin
)
def
get_identifier
(
self
):
return
"
probe_ui_hooks
"
super
(
ProbeUIHooksFactory
,
self
).
__init__
(
plugin
=
plugin
,
*
args
,
**
kwargs
)
def
get_name
(
self
):
return
"
Probe UI Hooks
"
def
get_ui_hooks_manager_class
(
self
):
return
ProbeUIHooksManager
def
create_ui_hooks_manager
(
self
):
if
self
.
create_ui_hooks_manager_raises
:
raise
Exception
(
"
Boom
"
)
return
ProbeUIH
ooks
M
anager
(
self
)
return
self
.
ui_h
ooks
_m
anager
_class
(
self
)
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