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

« back to all changes in this revision

Viewing changes to tests/test_get_ami.py

  • Committer: Aaron Bentley
  • Date: 2016-02-09 17:37:54 UTC
  • mto: This revision was merged to the branch mainline in revision 1260.
  • Revision ID: aaron.bentley@canonical.com-20160209173754-a1qbialilhwp4lkm
Implement get_controller_member_status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
        ]
46
46
        with mock.patch("subprocess.check_output", return_value=results,
47
47
                        autospec=True) as co_mock:
48
 
            ami = get_ami.query_ami("trusty", "amd64", region="cn-north-1")
49
 
            self.assertEqual(ami, "ami-first")
50
 
        co_mock.assert_called_once_with(expected_args)
51
 
 
52
 
    def test_query_ami_daily_stream(self):
53
 
        results = "ami-first\nami-second\nami-third\n"
54
 
        expected_args = [
55
 
            'sstream-query',
56
 
            get_ami.DAILY_INDEX,
57
 
            'endpoint~ec2.us-east-1.amazonaws.com',
58
 
            'arch=amd64',
59
 
            'release=trusty',
60
 
            'root_store=ssd',
61
 
            'virt=pv',
62
 
            '--output-format', '%(id)s'
63
 
        ]
64
 
        with mock.patch("subprocess.check_output", return_value=results,
65
 
                        autospec=True) as co_mock:
66
 
            ami = get_ami.query_ami("trusty", "amd64", stream="daily")
 
48
            ami = get_ami.query_ami("trusty", "amd64", "cn-north-1")
67
49
            self.assertEqual(ami, "ami-first")
68
50
        co_mock.assert_called_once_with(expected_args)
69
51