Ejemplo n.º 1
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_error(self):
     """
     tests False function versions error.
     """
     with patch.dict(boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}):
         self.conn.list_versions_by_function.side_effect = ClientError(error_content, "list_versions_by_function")
         result = boto_lambda.list_function_versions(FunctionName="testfunction", **conn_parameters)
     self.assertEqual(result.get("error", {}).get("message"), error_message.format("list_versions_by_function"))
Ejemplo n.º 2
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_false(self):
     """
     tests False no function versions listed.
     """
     with patch.dict(boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}):
         self.conn.list_versions_by_function.return_value = {"Versions": []}
         result = boto_lambda.list_function_versions(FunctionName="testfunction", **conn_parameters)
     self.assertFalse(result["Versions"])
Ejemplo n.º 3
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_error(self):
     '''
     tests False function versions error.
     '''
     with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         self.conn.list_versions_by_function.side_effect = ClientError(error_content, 'list_versions_by_function')
         result = boto_lambda.list_function_versions(FunctionName='testfunction',
                                                 **conn_parameters)
     self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_versions_by_function'))
Ejemplo n.º 4
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_false(self):
     '''
     tests False no function versions listed.
     '''
     with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         self.conn.list_versions_by_function.return_value = {'Versions': []}
         result = boto_lambda.list_function_versions(FunctionName='testfunction',
                                                 **conn_parameters)
     self.assertFalse(result['Versions'])
Ejemplo n.º 5
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_error(self):
     '''
     tests False function versions error.
     '''
     with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         self.conn.list_versions_by_function.side_effect = ClientError(error_content, 'list_versions_by_function')
         result = boto_lambda.list_function_versions(FunctionName='testfunction',
                                                 **conn_parameters)
     self.assertEqual(result.get('error', {}).get('message'), error_message.format('list_versions_by_function'))
Ejemplo n.º 6
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_false(self):
     '''
     tests False no function versions listed.
     '''
     with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}):
         self.conn.list_versions_by_function.return_value = {'Versions': []}
         result = boto_lambda.list_function_versions(FunctionName='testfunction',
                                                 **conn_parameters)
     self.assertFalse(result['Versions'])
Ejemplo n.º 7
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_false(
     self, ):
     """
     tests False no function versions listed.
     """
     with patch.dict(
             boto_lambda.__salt__,
         {"boto_iam.get_account_id": MagicMock(return_value="1234")},
     ):
         self.conn.list_versions_by_function.return_value = {"Versions": []}
         result = boto_lambda.list_function_versions(
             FunctionName="testfunction", **conn_parameters)
     self.assertFalse(result["Versions"])
Ejemplo n.º 8
0
 def test_that_when_listing_function_versions_fails_the_list_function_versions_method_returns_error(
     self, ):
     """
     tests False function versions error.
     """
     with patch.dict(
             boto_lambda.__salt__,
         {"boto_iam.get_account_id": MagicMock(return_value="1234")},
     ):
         self.conn.list_versions_by_function.side_effect = ClientError(
             error_content, "list_versions_by_function")
         result = boto_lambda.list_function_versions(
             FunctionName="testfunction", **conn_parameters)
     self.assertEqual(
         result.get("error", {}).get("message"),
         error_message.format("list_versions_by_function"),
     )