summaryrefslogtreecommitdiff
path: root/tooz/tests
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2016-11-10 17:31:35 +0100
committerJulien Danjou <julien@danjou.info>2016-11-30 14:57:53 +0100
commit0b1723ed776b8fe521aaf74bacdc5f440eb08ad9 (patch)
treee4c96a7626251edb77c5c7cf9283a284ea94a1fa /tooz/tests
parentca432a0de569c0aa81d9b2a1b0410414699ae5e8 (diff)
downloadtooz-0b1723ed776b8fe521aaf74bacdc5f440eb08ad9.tar.gz
Move the cached-based watcher implementation into its own class
There's a lot of methods implementing the common watcher tools that are inherited from all drivers whereas there is no need for that. The mixin is actually not correctly designed, as it mixes the hooks and the cache code. This splits out the common implementation into its common class that can be inherited to implement this model of driver. The Kazoo and Zake drivers are also merged to simplify code, as the base class was not used. Change-Id: I1acbf1983165d00e68b96cbca2bc5c1e2acadfa8
Diffstat (limited to 'tooz/tests')
-rw-r--r--tooz/tests/test_coordination.py2
-rw-r--r--tooz/tests/test_memcache.py5
2 files changed, 4 insertions, 3 deletions
diff --git a/tooz/tests/test_coordination.py b/tooz/tests/test_coordination.py
index 2d44474..fa59819 100644
--- a/tooz/tests/test_coordination.py
+++ b/tooz/tests/test_coordination.py
@@ -552,7 +552,7 @@ class TestAPI(tests.TestCaseSkipNotImplemented):
# client now no longer believes its part of the group.
if (hasattr(self._coord, '_joined_groups')
and (self._coord.run_watchers
- == tooz.coordination._RunWatchersMixin.run_watchers)):
+ == tooz.coordination.CoordinationDriverCachedRunWatchers.run_watchers)): # noqa
self.assertIn(self.group_id, self._coord._joined_groups)
self._coord.run_watchers()
self.assertNotIn(self.group_id, self._coord._joined_groups)
diff --git a/tooz/tests/test_memcache.py b/tooz/tests/test_memcache.py
index 787a96b..07bb815 100644
--- a/tooz/tests/test_memcache.py
+++ b/tooz/tests/test_memcache.py
@@ -70,8 +70,9 @@ class TestMemcacheDriverFailures(testcase.TestCase):
mock_client.set.side_effect = socket.timeout('timed-out')
self.assertRaises(coordination.ToozConnectionError, coord.heartbeat)
- @mock.patch('tooz.coordination._RunWatchersMixin.run_watchers',
- autospec=True)
+ @mock.patch(
+ 'tooz.coordination.CoordinationDriverCachedRunWatchers.run_watchers',
+ autospec=True)
@mock.patch('pymemcache.client.PooledClient')
def test_client_run_watchers_mixin(self, mock_client_cls,
mock_run_watchers):