~abentley/juju-ci-tools/client-from-config-4

« back to all changes in this revision

Viewing changes to tests/test_assess_cs_staging.py

  • Committer: Aaron Bentley
  • Date: 2016-07-05 14:15:26 UTC
  • mfrom: (1468.1.6 client-from-config-3)
  • Revision ID: aaron.bentley@canonical.com-20160705141526-v1gveg82a4swb3fb
Merged client-from-config-3 into client-from-config-4.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
 
45
45
class TestSetCharmStoreIP(TestCase):
46
46
 
47
 
    def test_default_as_admin(self):
 
47
    def test_default_as_controller(self):
48
48
        client = fake_juju_client_optional_jes(jes_enabled=False)
49
49
        client.bootstrap()
50
50
        with patch.object(client, 'juju', autospec=True) as juju_mock:
52
52
        juju_mock.assert_called_once_with(
53
53
            'ssh', ('0', _get_ssh_script('1.2.3.4')))
54
54
 
55
 
    def test_separate_admin(self):
 
55
    def test_separate_controller(self):
56
56
        client = fake_juju_client()
57
57
        client.bootstrap()
58
 
        admin_client = client.get_admin_client()
59
 
        # Force get_admin_client to return the *same* client, instead of an
60
 
        # equivalent one.
61
 
        with patch.object(client, 'get_admin_client',
62
 
                          return_value=admin_client, autospec=True):
63
 
            with patch.object(admin_client, 'juju',
 
58
        controller_client = client.get_controller_client()
 
59
        # Force get_controller_client to return the *same* client, instead of
 
60
        # an equivalent one.
 
61
        with patch.object(client, 'get_controller_client',
 
62
                          return_value=controller_client, autospec=True):
 
63
            with patch.object(controller_client, 'juju',
64
64
                              autospec=True) as juju_mock:
65
65
                _set_charm_store_ip(client, '1.2.3.4')
66
66
        juju_mock.assert_called_once_with(