URL: https://github.com/freeipa/freeipa/pull/141 Author: mirielka Title: #141: Tests: Fix failing test_ipalib/test_parameters Action: opened
PR body: """ Parameters test fails because of KeyError caused by improper manipulation with kwargs in Param.__init__ method. During initialization, if kwargs['required'] or kwargs['multivalue'] is None, it is delete from dictionary and hence the missing key. Small change of the condition prevents this from happening. Partially fixes https://fedorahosted.org/freeipa/ticket/6292 """ To pull the PR as Git branch: git remote add ghfreeipa https://github.com/freeipa/freeipa git fetch ghfreeipa pull/141/head:pr141 git checkout pr141
From a6f076cac03e3672399abccf0639b0d6035147b6 Mon Sep 17 00:00:00 2001 From: Lenka Doudova <[email protected]> Date: Thu, 6 Oct 2016 10:54:07 +0200 Subject: [PATCH] Tests: Fix failing test_ipalib/test_parameters Parameters test fails because of KeyError caused by improper manipulation with kwargs in Param.__init__ method. During initialization, if kwargs['required'] or kwargs['multivalue'] is None, it is delete from dictionary and hence the missing key. Small change of the condition prevents this from happening. Partially fixes https://fedorahosted.org/freeipa/ticket/6292 --- ipalib/parameters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 77a6136..32ff9a8 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -473,7 +473,7 @@ def __init__(self, name, *rules, **kw): CALLABLE_ERROR % (key, value, type(value)) ) kw[key] = value - else: + elif key not in ('required', 'multivalue'): kw.pop(key, None) # We keep these values to use in __repr__():
-- Manage your subscription for the Freeipa-devel mailing list: https://www.redhat.com/mailman/listinfo/freeipa-devel Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code
