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)
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)
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
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'])
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"])
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})
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})
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"])
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})