Skip to content
Snippets Groups Projects
Commit 53015b51 authored by Stefano Borini's avatar Stefano Borini
Browse files

Added trivial testing

parent b8574f23
No related branches found
No related tags found
1 merge request!93UI Hooks
......@@ -4,7 +4,7 @@ from traits.api import ABCHasStrictTraits, Instance
from .i_ui_hooks_factory import IUIHooksFactory
class BaseUIHookManager(ABCHasStrictTraits):
class BaseUIHooksManager(ABCHasStrictTraits):
#: A reference to the factory
factory = Instance(IUIHooksFactory)
......@@ -17,9 +17,8 @@ class BaseUIHookManager(ABCHasStrictTraits):
The factory this Notification Listener belongs to
"""
self.factory = factory
super(BaseUIHookManager, self).__init__(*args, **kwargs)
super(BaseUIHooksManager, self).__init__(*args, **kwargs)
@abc.abstractmethod
def before_execution(self, task):
"""Hook that is called before execution of a given evaluation.
Gives a chance to perform operations before the temporary file is
......@@ -31,7 +30,6 @@ class BaseUIHookManager(ABCHasStrictTraits):
The pyface envisage task.
"""
@abc.abstractmethod
def before_save(self, task):
"""Hook that is called just before saving a given model to disk
in response to a user action. This does not apply to saving of
......
import unittest
from ..base_ui_hooks_manager import BaseUIHooksManager
from ..base_ui_hooks_factory import BaseUIHooksFactory
try:
import mock
except ImportError:
from unittest import mock
class TestBaseUIHookManager(unittest.TestCase):
def test_initialization(self):
mock_factory = mock.Mock(spec=BaseUIHooksFactory)
mgr = BaseUIHooksManager(mock_factory)
self.assertEqual(mgr.factory, mock_factory)
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