Index: quickstart/tests/test_app.py |
=== modified file 'quickstart/tests/test_app.py' |
--- quickstart/tests/test_app.py 2014-04-04 15:49:16 +0000 |
+++ quickstart/tests/test_app.py 2014-04-21 21:02:09 +0000 |
@@ -572,23 +572,25 @@ |
] + self.make_status_calls(2)) |
-class TestGetAdminSecret(unittest.TestCase): |
+class TestGetValueFromJenv(unittest.TestCase): |
- def test_no_admin_secret(self): |
+ def test_no_key(self): |
with mock.patch('quickstart.manage.envs.load_generated', |
lambda x: {}): |
with self.assertRaises(ValueError) as exc: |
- app.get_admin_secret('local', '/home/bac/.juju') |
+ app.get_value_from_jenv( |
+ 'local', '/home/bac/.juju', 'my-key') |
expected = ( |
- u'admin-secret not found in ' |
+ u'my-key not found in ' |
'/home/bac/.juju/environments/local.jenv') |
self.assertIn(expected, bytes(exc.exception)) |
def test_success(self): |
expected = 'superchunk' |
with mock.patch('quickstart.manage.envs.load_generated', |
- lambda x: {'admin-secret': expected}): |
- secret = app.get_admin_secret('local', '~bac/.juju') |
+ lambda x: {'my-key': expected}): |
+ secret = app.get_value_from_jenv( |
+ 'local', '~bac/.juju', 'my-key') |
self.assertEqual(expected, secret) |