~viswesn/juju-ci-tools/aws_boto3

« back to all changes in this revision

Viewing changes to tests/test_quickstart_deploy.py

  • Committer: Curtis Hovey
  • Date: 2017-01-25 02:32:29 UTC
  • mfrom: (1855 trunk)
  • mto: This revision was merged to the branch mainline in revision 1865.
  • Revision ID: curtis@canonical.com-20170125023229-g7c6bzt0cqe1j8g3
Merged trunk and resolved conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
)
6
6
 
7
7
from deploy_stack import BootstrapManager
8
 
from fakejuju import fake_juju_client
9
8
from jujupy import (
10
 
    EnvJujuClient,
 
9
    ModelClient,
 
10
    fake_juju_client,
11
11
    JujuData,
12
12
    )
13
13
from quickstart_deploy import QuickstartTest
37
37
            finally:
38
38
                do_finally()
39
39
 
40
 
        client = EnvJujuClient(
 
40
        client = ModelClient(
41
41
            JujuData('foo', {'type': 'local'}), '1.234-76', None)
42
42
        bs_manager = make_bootstrap_manager(client)
43
43
        quickstart = QuickstartTest(bs_manager, '/tmp/bundle.yaml', 2)
55
55
            except:
56
56
                tear_down()
57
57
 
58
 
        client = EnvJujuClient(
 
58
        client = ModelClient(
59
59
            JujuData('foo', {'type': 'local'}), '1.234-76', None)
60
60
        bs_manager = make_bootstrap_manager(client)
61
61
        quickstart = QuickstartTest(bs_manager, '/tmp/bundle.yaml', 2)
68
68
 
69
69
    def test_iter_steps(self):
70
70
        log_dir = use_context(self, temp_dir())
71
 
        client = EnvJujuClient(
 
71
        client = ModelClient(
72
72
            JujuData('foo', {'type': 'local'}), '1.234-76', None)
73
73
        bs_manager = make_bootstrap_manager(client, log_dir=log_dir)
74
74
        quickstart = QuickstartTest(bs_manager, '/tmp/bundle.yaml', 2)
75
75
        steps = quickstart.iter_steps()
76
76
        with patch.object(client, 'quickstart') as qs_mock:
77
77
            # Test first yield
78
 
            with patch('jujupy.check_free_disk_space', autospec=True):
 
78
            with patch('jujupy.client.check_free_disk_space',
 
79
                       autospec=True):
79
80
                with patch.object(client, 'kill_controller',
80
81
                                  autospec=True) as kill_mock:
81
82
                    step = steps.next()
103
104
        with patch('deploy_stack.safe_print_status'):
104
105
            with patch('deploy_stack.BootstrapManager.tear_down'):
105
106
                with patch('quickstart_deploy.BootstrapManager.dump_all_logs'):
106
 
                    with patch('jujupy.EnvJujuClient.iter_model_clients',
 
107
                    with patch('jujupy.ModelClient.iter_model_clients',
107
108
                               return_value=[]):
108
109
                        steps.close()
109
110
 
143
144
        self.assertIs(True, bs_manager.exited_top)
144
145
 
145
146
    def test_iter_steps_quickstart_fail(self):
146
 
        client = EnvJujuClient(
 
147
        client = ModelClient(
147
148
            JujuData('foo', {'type': 'local'}), '1.234-76', None)
148
149
        bs_manager = FakeBootstrapManager(client)
149
150
        quickstart = QuickstartTest(bs_manager, '/tmp/bundle.yaml', 2)