diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-05-02 16:36:44 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-05-02 16:36:45 +0000 |
| commit | 86a99c463422d3dcbf6849153a4cadd892ed3247 (patch) | |
| tree | 4de8319e85d59120ff8e79012dac011e39f964ab /tests | |
| parent | 85134c9e4f666187fcde8bc9e40526867514b85a (diff) | |
| parent | 025d57f82005a4ea92950f9b4d717c88f647d15f (diff) | |
| download | kolla-86a99c463422d3dcbf6849153a4cadd892ed3247.tar.gz kolla-86a99c463422d3dcbf6849153a4cadd892ed3247.zip | |
Merge "Remove dependencies on kazoo and friends"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_set_config.py | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/tests/test_set_config.py b/tests/test_set_config.py index 03975d156..3e946c797 100644 --- a/tests/test_set_config.py +++ b/tests/test_set_config.py @@ -15,11 +15,8 @@ import json import mock import os.path import sys -import tempfile from oslotest import base -import testscenarios -from zake import fake_client # nasty: to import set_config (not a part of the kolla package) this_dir = os.path.dirname(sys.modules[__name__].__file__) @@ -67,58 +64,3 @@ class LoadFromEnv(base.BaseTestCase): mock.call().write(u'/bin/true'), mock.call().__exit__(None, None, None)], mo.mock_calls) - - -class ZkCopyTest(testscenarios.WithScenarios, base.BaseTestCase): - - scenarios = [ - ('1', dict(in_paths=['a.conf'], - in_subtree='/', - expect_paths=[['a.conf']])), - ('2', dict(in_paths=['/a/b/c.x', '/a/b/foo.x', '/a/no.x'], - in_subtree='/a/b', - expect_paths=[['c.x'], ['foo.x']])), - ('3', dict(in_paths=['/a/b/c.x', '/a/z/foo.x'], - in_subtree='/', - expect_paths=[['a', 'b', 'c.x'], ['a', 'z', 'foo.x']])), - ] - - def setUp(self): - super(ZkCopyTest, self).setUp() - self.client = fake_client.FakeClient() - self.client.start() - self.addCleanup(self.client.stop) - self.addCleanup(self.client.close) - - def test_cp_tree(self): - # Note: oslotest.base cleans up all tempfiles as follows: - # self.useFixture(fixtures.NestedTempfile()) - # so we don't have to. - temp_dir = tempfile.mkdtemp() - - for path in self.in_paths: - self.client.create(path, b'one', makepath=True) - set_configs.zk_copy_tree(self.client, self.in_subtree, temp_dir) - for expect in self.expect_paths: - expect.insert(0, temp_dir) - expect_path = os.path.join(*expect) - self.assertTrue(os.path.exists(expect_path)) - - -class ZkExistsTest(base.BaseTestCase): - def setUp(self): - super(ZkExistsTest, self).setUp() - self.client = fake_client.FakeClient() - self.client.start() - self.addCleanup(self.client.stop) - self.addCleanup(self.client.close) - - def test_path_exists_no(self): - self.client.create('/test/path/thing', b'one', makepath=True) - self.assertFalse(set_configs.zk_path_exists(self.client, - '/test/missing/thing')) - - def test_path_exists_yes(self): - self.client.create('/test/path/thing', b'one', makepath=True) - self.assertTrue(set_configs.zk_path_exists(self.client, - '/test/path/thing')) |
