summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2015-02-13 17:50:15 -0800
committerJoshua Harlow <harlowja@yahoo-inc.com>2015-02-13 17:50:15 -0800
commitfc66eaddaf79f17984b7099f927d07fae1470296 (patch)
treee3b76ee533efe88b4ab8b5c17d1068c8c641e3da
parent799a555e58354be993a6bba780ef86c920f3692b (diff)
downloadzake-fc66eaddaf79f17984b7099f927d07fae1470296.tar.gz
Add basic envi command support
-rw-r--r--zake/fake_client.py7
-rw-r--r--zake/tests/test_client.py7
2 files changed, 14 insertions, 0 deletions
diff --git a/zake/fake_client.py b/zake/fake_client.py
index 6c4787f..d5554d0 100644
--- a/zake/fake_client.py
+++ b/zake/fake_client.py
@@ -131,6 +131,13 @@ class FakeClient(object):
'Mode: standalone'])
if cmd == "kill":
self.stop()
+ if cmd == 'envi':
+ server_version = ".".join([str(s) for s in self._server_version])
+ lines = [
+ "Environment:",
+ "zookeeper.version=%s" % server_version,
+ ]
+ return "\n".join(lines)
return ''
def verify(self):
diff --git a/zake/tests/test_client.py b/zake/tests/test_client.py
index 334cc05..44e0acd 100644
--- a/zake/tests/test_client.py
+++ b/zake/tests/test_client.py
@@ -87,6 +87,13 @@ class TestClient(test.Test):
version = ".".join([str(s) for s in fake_client.SERVER_VERSION])
self.assertIn(version, stats)
+ def test_command_envi(self):
+ with start_close(self.client) as c:
+ envi = c.command('envi')
+ self.assertIn("zookeeper.version", envi)
+ version = ".".join([str(s) for s in fake_client.SERVER_VERSION])
+ self.assertIn(version, envi)
+
def test_command_empty_version(self):
self.assertRaises(ValueError, fake_client.FakeClient,
server_version=[])