コード例 #1
0
    def setUp(self):
        super(TestAbort, self).setUp()
        fileoperations.create_config_file('myEBCLItest', 'us-west-2',
                                          'my-stack-stack')
        commonops.set_environment_for_current_branch('my-env')

        mockservice.enqueue('elasticbeanstalk', 'AbortEnvironmentUpdate',
                            standard_abort())
コード例 #2
0
    def test_abort_provided(self):
        mockservice.enqueue('elasticbeanstalk', 'DescribeEnvironments',
                            describe_env_all_abortable())

        self.run_command('abort', 'bad-env')
        self.assertTrue(
            mockservice.called_with(
                'elasticbeanstalk', 'AbortEnvironmentUpdate', {
                    'Action': u'AbortEnvironmentUpdate',
                    'EnvironmentName': 'bad-env',
                    'Version': u'2010-12-01'
                }))
        self.mock_input.assert_not_called()
コード例 #3
0
    def test_abort_multiple(self):
        mockservice.enqueue('elasticbeanstalk', 'DescribeEnvironments',
                            describe_env_all_abortable())

        self.run_command('abort')
        self.assertTrue(
            mockservice.called_with(
                'elasticbeanstalk', 'AbortEnvironmentUpdate', {
                    'Action': u'AbortEnvironmentUpdate',
                    'EnvironmentName': 'single-env',
                    'Version': u'2010-12-01'
                }))
        self.mock_input.assert_called_with('(default is 1)', 1)
コード例 #4
0
    def test_abort_none(self):
        mockservice.enqueue('elasticbeanstalk', 'DescribeEnvironments',
                            describe_env_none_abortable())

        try:
            self.run_command('abort')
            self.fail('Should have thrown exception')
        except NotFoundError:
            pass
        self.assertEqual(
            len(
                mockservice.get_calls('elasticbeanstalk',
                                      'AbortEnvironmentUpdate')), 0)
        self.mock_input.assert_not_called()
コード例 #5
0
 def test_abort_standard(self):
     mockservice.enqueue('elasticbeanstalk', 'DescribeEnvironments',
                         describe_env_all_abortable())
     self.run_command('abort')