Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18)

Unified Diff: tests/test_utils.py

Issue 6846132: Juju GUI charm connects to its environment
Patch Set: Juju GUI charm connects to its environment Created 12 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/deploy.test ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/test_utils.py
=== modified file 'tests/test_utils.py'
--- tests/test_utils.py 2012-11-21 11:27:24 +0000
+++ tests/test_utils.py 2012-11-29 14:49:41 +0000
@@ -4,7 +4,26 @@
import tempfile
import unittest
-from utils import render_to_file
+from utils import (
+ get_zookeeper_address,
+ render_to_file,
+)
+
+
+class GetZookeeperAddressTest(unittest.TestCase):
+
+ def setUp(self):
+ self.zookeeper_address = 'example.com:2000'
+ contents = 'env JUJU_ZOOKEEPER="{0}"\n'.format(self.zookeeper_address)
+ with tempfile.NamedTemporaryFile(delete=False) as agent_file:
+ agent_file.write(contents)
+ self.agent_file_path = agent_file.name
+ self.addCleanup(os.remove, self.agent_file_path)
+
+ def test_get_zookeeper_address(self):
+ # Ensure the Zookeeper address is correctly retreived.
+ address = get_zookeeper_address(self.agent_file_path)
+ self.assertEqual(self.zookeeper_address, address)
class RenderToFileTest(unittest.TestCase):
« no previous file with comments | « tests/deploy.test ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b