~gz/juju-ci-tools/jes_no_upload

« back to all changes in this revision

Viewing changes to test_jujupy.py

  • Committer: Aaron Bentley
  • Date: 2015-08-11 13:48:41 UTC
  • mfrom: (1050.2.9 copy-cache)
  • Revision ID: aaron.bentley@canonical.com-20150811134841-780kgxioxll2ublp
SupportĀ archivingĀ cache.yaml

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
    EnvJujuClient25,
37
37
    ErroredUnit,
38
38
    GroupReporter,
 
39
    get_cache_path,
39
40
    get_local_root,
40
41
    jes_home_path,
41
42
    JESByDefault,
1120
1121
        self.assertEqual(err_cxt.exception.cmd, (
1121
1122
            'juju', '--show-log', 'foo', '-e', 'qux', 'bar', 'baz'))
1122
1123
 
 
1124
    def test_is_jes_enabled(self):
 
1125
        env = SimpleEnvironment('qux')
 
1126
        client = EnvJujuClient(env, None, '/foobar/baz')
 
1127
        with patch('subprocess.check_output',
 
1128
                   return_value=' system') as co_mock:
 
1129
            self.assertFalse(client.is_jes_enabled())
 
1130
        assert_juju_call(self, co_mock, client, (
 
1131
            'juju', '--show-log', 'help', 'commands'), assign_stderr=True)
 
1132
        with patch('subprocess.check_output', autospec=True,
 
1133
                   return_value='system') as co_mock:
 
1134
            self.assertTrue(client.is_jes_enabled())
 
1135
 
1123
1136
    def test_get_juju_timings(self):
1124
1137
        env = Environment('foo', '')
1125
1138
        client = EnvJujuClient(env, None, 'my/juju/bin')
1194
1207
        self.assertEqual(path, '/home/jrandom/foo/jes-homes/bar')
1195
1208
 
1196
1209
 
 
1210
class TestGetCachePath(TestCase):
 
1211
 
 
1212
    def test_get_cache_path(self):
 
1213
        path = get_cache_path('/home/jrandom/foo')
 
1214
        self.assertEqual(path, '/home/jrandom/foo/environments/cache.yaml')
 
1215
 
 
1216
 
1197
1217
class TestMakeJESHome(TestCase):
1198
1218
 
1199
1219
    def test_make_jes_home(self):