def test_ssl_delete(self): iam_mock = mock.Mock() iam_connect_result = mock.Mock(name='iam_connect') iam_mock.return_value = iam_connect_result boto.iam.connect_to_region = iam_mock i = iam.IAM(self.env.aws_profile) x = i.delete_ssl_certificate({}, self.stack_name) self.assertTrue(x)
def iam_mock(self): iam_mock = Mock() iam_connect_result = Mock(name='iam_connect') iam_mock.return_value = iam_connect_result mock_config = {'delete_ssl_certificate.return_value': True} iam_connect_result.configure_mock(**mock_config) boto.iam.connect_to_region = iam_mock i = iam.IAM("profile_name") return i
def setUp(self): iam_mock = Mock() iam_connect_result = Mock(name='iam_connect') iam_mock.return_value = iam_connect_result boto.iam.connect_to_region = iam_mock self.mock_iam = iam.IAM('mock_profile')