Small changes in events, and associated tests.

This commit is contained in:
Romain Dorgueil
2017-11-04 13:20:53 +01:00
parent 28884231b3
commit 83fc1743fc
4 changed files with 23 additions and 6 deletions

View File

@ -0,0 +1,17 @@
from unittest.mock import Mock
from bonobo.execution import events
def test_names():
# This test looks useless, but as it's becoming the pliugin API, I want to make sure that nothing changes here, or
# notice it otherwise.
for name in 'start', 'started', 'tick', 'stop', 'stopped', 'kill':
event_name = getattr(events, name.upper())
assert event_name == '.'.join(('execution', name))
def test_event_object():
# Same logic as above.
c = Mock()
e = events.ExecutionEvent(c)
assert e.context is c