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
18b4446a
Commit
18b4446a
authored
7 years ago
by
Stefano Borini
Browse files
Options
Downloads
Patches
Plain Diff
Coverage
parent
dbb8757a
No related branches found
No related tags found
1 merge request
!79
Deliver notification info
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
force_bdss/core_plugins/dummy/ui_notification/ui_notification.py
+2
-1
2 additions, 1 deletion
...dss/core_plugins/dummy/ui_notification/ui_notification.py
force_bdss/tests/test_core_mco_driver.py
+24
-1
24 additions, 1 deletion
force_bdss/tests/test_core_mco_driver.py
with
26 additions
and
2 deletions
force_bdss/core_plugins/dummy/ui_notification/ui_notification.py
+
2
−
1
View file @
18b4446a
...
...
@@ -68,7 +68,8 @@ class UINotification(BaseNotificationListener):
return
msg
=
_format_event
(
event
,
self
.
_identifier
)
self
.
_pub_socket
.
send_string
(
msg
)
if
msg
is
not
None
:
self
.
_pub_socket
.
send_string
(
msg
)
def
finalize
(
self
):
if
not
self
.
_context
:
...
...
This diff is collapsed.
Click to expand it.
force_bdss/tests/test_core_mco_driver.py
+
24
−
1
View file @
18b4446a
...
...
@@ -2,6 +2,8 @@ import unittest
from
testfixtures
import
LogCapture
from
force_bdss.mco.events
import
MCOStartEvent
from
force_bdss.notification_listeners.base_notification_listener
import
\
BaseNotificationListener
from
force_bdss.tests
import
fixtures
from
force_bdss.tests.test_core_evaluation_driver
import
\
mock_factory_registry_plugin
...
...
@@ -56,7 +58,28 @@ class TestCoreMCODriver(unittest.TestCase):
driver
.
mco
.
event
=
event
self
.
assertTrue
(
mock_deliver
.
call_args
[
0
][
0
],
event
)
def
test_listener_initialization_exception
(
self
):
def
test_listener_init_exception
(
self
):
driver
=
CoreMCODriver
(
application
=
self
.
mock_application
,
)
registry
=
self
.
mock_factory_registry_plugin
factory
=
registry
.
notification_listener_factories
[
0
]
mock_create_listener
=
mock
.
Mock
()
mock_listener
=
mock
.
Mock
(
spec
=
BaseNotificationListener
)
mock_create_listener
.
return_value
=
mock_listener
mock_listener
.
initialize
=
mock
.
Mock
()
mock_listener
.
initialize
.
side_effect
=
Exception
()
factory
.
__dict__
[
"
create_listener
"
]
=
mock_create_listener
with
LogCapture
()
as
capture
:
listeners
=
driver
.
listeners
capture
.
check
(
(
"
force_bdss.core_mco_driver
"
,
"
ERROR
"
,
"
Failed to create or initialize listener with id
"
"
force.bdss.enthought.factory.null_nl:
"
))
def
test_listener_delivery_exception
(
self
):
driver
=
CoreMCODriver
(
application
=
self
.
mock_application
,
)
...
...
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