~sseman/juju-ci-tools/model-change-watcher-py3-2

« back to all changes in this revision

Viewing changes to tests/test_aws.py

  • Committer: Curtis Hovey
  • Date: 2016-11-28 20:37:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1769.
  • Revision ID: curtis@canonical.com-20161128203753-nhgi0drtumnub4zw
make region a positional arg.

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
            with patch('aws.list_instances', autospec=True) as li_mock:
52
52
                with patch.dict('os.environ', AWS_ENVIRON):
53
53
                    code = aws.main(
54
 
                        ['aws.py', '--region', 'us-west-1',
 
54
                        ['aws.py', 'us-west-1',
55
55
                         'list-instances', 'juju-deploy*'])
56
56
        self.assertEqual(0, code)
57
57
        gc_mock.assert_called_once_with(
67
67
            with patch('aws.delete_instances', autospec=True) as di_mock:
68
68
                with patch.dict('os.environ', AWS_ENVIRON):
69
69
                    code = aws.main(
70
 
                        ['aws.py', '--region', 'us-west-1',
 
70
                        ['aws.py', 'us-west-1',
71
71
                         'delete-instances', '-o', '2', 'juju-deploy*'])
72
72
        self.assertEqual(0, code)
73
73
        gc_mock.assert_called_once_with(
79
79
    def test_parse_args_delete_instaces(self):
80
80
        with patch.dict('os.environ', AWS_ENVIRON):
81
81
            args = aws.parse_args(
82
 
                ['aws.py', '-v', '-d', '--region', 'us-west-1',
 
82
                ['aws.py', '-v', '-d', 'us-west-1',
83
83
                 'delete-instances', '-o', '2', 'juju-deploy*'])
84
84
        expected = Namespace(
85
85
            command='delete-instances', dry_run=True, filter='juju-deploy*',
90
90
    def test_parse_args_list_instances(self):
91
91
        with patch.dict('os.environ', AWS_ENVIRON):
92
92
            args = aws.parse_args(
93
 
                ['aws.py', '-v', '-d', '--region', 'us-west-1',
 
93
                ['aws.py', '-v', '-d', 'us-west-1',
94
94
                 'list-instances', 'juju-deploy*'])
95
95
        expected = Namespace(
96
96
            command='list-instances', dry_run=True, filter='juju-deploy*',
100
100
 
101
101
    def test_parse_args_without_env(self):
102
102
        args = aws.parse_args(
103
 
            ['aws.py', '-v', '-d', '--region', 'us-west-1',
 
103
            ['aws.py', '-v', '-d', 'us-west-1',
104
104
             '--aws-access-key', 'access123', '--aws-secret', 'secret',
105
105
             'delete-instances', '-o', '2', 'juju-deploy*'])
106
106
        expected = Namespace(