def test_that_when_deleting_a_function_fails_the_delete_function_method_returns_false(self): """ tests False function not deleted. """ with patch.dict(boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}): self.conn.delete_function.side_effect = ClientError(error_content, "delete_function") result = boto_lambda.delete_function(FunctionName="testfunction", **conn_parameters) self.assertFalse(result["deleted"])
def test_that_when_deleting_a_function_succeeds_the_delete_function_method_returns_true(self): """ tests True function deleted. """ with patch.dict(boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}): result = boto_lambda.delete_function(FunctionName="testfunction", Qualifier=1, **conn_parameters) self.assertTrue(result["deleted"])
def test_that_when_deleting_a_function_fails_the_delete_function_method_returns_false(self): ''' tests False function not deleted. ''' with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}): self.conn.delete_function.side_effect = ClientError(error_content, 'delete_function') result = boto_lambda.delete_function(FunctionName='testfunction', **conn_parameters) self.assertFalse(result['deleted'])
def test_that_when_deleting_a_function_succeeds_the_delete_function_method_returns_true(self): ''' tests True function deleted. ''' with patch.dict(boto_lambda.__salt__, {'boto_iam.get_account_id': MagicMock(return_value='1234')}): result = boto_lambda.delete_function(FunctionName='testfunction', Qualifier=1, **conn_parameters) self.assertTrue(result['deleted'])
def test_that_when_deleting_a_function_fails_the_delete_function_method_returns_false( self, ): """ tests False function not deleted. """ with patch.dict( boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}, ): self.conn.delete_function.side_effect = ClientError(error_content, "delete_function") result = boto_lambda.delete_function(FunctionName="testfunction", **conn_parameters) assert not result["deleted"]
def test_that_when_deleting_a_function_succeeds_the_delete_function_method_returns_true( self, ): """ tests True function deleted. """ with patch.dict( boto_lambda.__salt__, {"boto_iam.get_account_id": MagicMock(return_value="1234")}, ): result = boto_lambda.delete_function(FunctionName="testfunction", Qualifier=1, **conn_parameters) self.assertTrue(result["deleted"])