Ejemplo n.º 1
0
 def test_that_when_describing_lambda_on_client_error_it_returns_error(self):
     '''
     Tests describing parameters failure
     '''
     self.conn.list_functions.side_effect = ClientError(error_content, 'list_functions')
     result = boto_lambda.describe_function(FunctionName='testfunction', **conn_parameters)
     self.assertTrue('error' in result)
Ejemplo n.º 2
0
 def test_that_when_describing_lambda_on_client_error_it_returns_error(self):
     """
     Tests describing parameters failure
     """
     self.conn.list_functions.side_effect = ClientError(error_content, "list_functions")
     result = boto_lambda.describe_function(FunctionName="testfunction", **conn_parameters)
     self.assertTrue("error" in result)
Ejemplo n.º 3
0
 def test_that_when_describing_lambda_on_client_error_it_returns_error(self):
     """
     Tests describing parameters failure
     """
     self.conn.list_functions.side_effect = ClientError(error_content, "list_functions")
     result = boto_lambda.describe_function(FunctionName="testfunction", **conn_parameters)
     assert "error" in result
Ejemplo n.º 4
0
 def test_that_when_describing_lambda_on_client_error_it_returns_error(self):
     '''
     Tests describing parameters failure
     '''
     self.conn.list_functions.side_effect = ClientError(error_content, 'list_functions')
     result = boto_lambda.describe_function(FunctionName='testfunction', **conn_parameters)
     self.assertTrue('error' in result)
Ejemplo n.º 5
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_false(self):
        '''
        Tests describing parameters if function does not exist
        '''
        self.conn.list_functions.return_value = {'Functions': []}
        with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_lambda.describe_function(FunctionName='testfunction', **conn_parameters)

        self.assertFalse(result['function'])
Ejemplo n.º 6
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_false(self):
        """
        Tests describing parameters if function does not exist
        """
        self.conn.list_functions.return_value = {"Functions": []}
        with patch.dict(boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}):
            result = boto_lambda.describe_function(FunctionName="testfunction", **conn_parameters)

        self.assertFalse(result["function"])
Ejemplo n.º 7
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_false(self):
        '''
        Tests describing parameters if function does not exist
        '''
        self.conn.list_functions.return_value = {'Functions': []}
        with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_lambda.describe_function(FunctionName='testfunction', **conn_parameters)

        self.assertFalse(result['function'])
Ejemplo n.º 8
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_true(self):
        '''
        Tests describing parameters if function exists
        '''
        self.conn.list_functions.return_value = {'Functions': [function_ret]}

        with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_lambda.describe_function(FunctionName=function_ret['FunctionName'], **conn_parameters)

        self.assertEqual(result, {'function': function_ret})
Ejemplo n.º 9
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_true(self):
        """
        Tests describing parameters if function exists
        """
        self.conn.list_functions.return_value = {"Functions": [function_ret]}

        with patch.dict(boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}):
            result = boto_lambda.describe_function(FunctionName=function_ret["FunctionName"], **conn_parameters)

        self.assertEqual(result, {"function": function_ret})
Ejemplo n.º 10
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_true(self):
        '''
        Tests describing parameters if function exists
        '''
        self.conn.list_functions.return_value = {'Functions': [function_ret]}

        with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
            result = boto_lambda.describe_function(FunctionName=function_ret['FunctionName'], **conn_parameters)

        self.assertEqual(result, {'function': function_ret})
Ejemplo n.º 11
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_false(
        self, ):
        """
        Tests describing parameters if function does not exist
        """
        self.conn.list_functions.return_value = {"Functions": []}
        with patch.dict(
                boto_lambda.__salt__,
            {"boto_iam.get_account_id": MagicMock(return_value="1234")},
        ):
            result = boto_lambda.describe_function(FunctionName="testfunction",
                                                   **conn_parameters)

        self.assertFalse(result["function"])
Ejemplo n.º 12
0
    def test_that_when_describing_function_it_returns_the_dict_of_properties_returns_true(
        self, ):
        """
        Tests describing parameters if function exists
        """
        self.conn.list_functions.return_value = {"Functions": [function_ret]}

        with patch.dict(
                boto_lambda.__salt__,
            {"boto_iam.get_account_id": MagicMock(return_value="1234")},
        ):
            result = boto_lambda.describe_function(
                FunctionName=function_ret["FunctionName"], **conn_parameters)

        self.assertEqual(result, {"function": function_ret})