diff options
author | Nathaniel McCallum <npmccallum@redhat.com> | 2014-02-21 11:38:32 -0500 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-02-25 16:05:19 +0100 |
commit | 4499b25be90227e54fc4a9f54598cadc8d2f6394 (patch) | |
tree | 2b1a855b42534751426a9f5b5865587b9bc17e1a /ipatests/test_ipalib | |
parent | be7b1b94e300b137c34bab80df3dc91195259c89 (diff) | |
download | freeipa-4499b25be90227e54fc4a9f54598cadc8d2f6394.tar.gz freeipa-4499b25be90227e54fc4a9f54598cadc8d2f6394.tar.xz freeipa-4499b25be90227e54fc4a9f54598cadc8d2f6394.zip |
Remove NULLS from constants.py
In the parameters system, we have been checking for a positive list of values
which get converted to None. The problem is that this method can in some
cases throw warnings when type coercion doesn't work (particularly, string
to unicode). Instead, any values that evaluate to False that are neither
numeric nor boolean should be converted to None.
Reviewed-By: Jan Pazdziora <jpazdziora@redhat.com>
Diffstat (limited to 'ipatests/test_ipalib')
-rw-r--r-- | ipatests/test_ipalib/test_parameters.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ipatests/test_ipalib/test_parameters.py b/ipatests/test_ipalib/test_parameters.py index d1956bede..278e07165 100644 --- a/ipatests/test_ipalib/test_parameters.py +++ b/ipatests/test_ipalib/test_parameters.py @@ -31,11 +31,13 @@ from ipatests.util import raises, ClassChecker, read_only from ipatests.util import dummy_ugettext, assert_equal from ipatests.data import binary_bytes, utf8_bytes, unicode_str from ipalib import parameters, text, errors, config -from ipalib.constants import TYPE_ERROR, CALLABLE_ERROR, NULLS +from ipalib.constants import TYPE_ERROR, CALLABLE_ERROR from ipalib.errors import ValidationError, ConversionError from ipalib import _ from xmlrpclib import MAXINT, MININT +NULLS = (None, '', u'', tuple(), []) + class test_DefaultFrom(ClassChecker): """ Test the `ipalib.parameters.DefaultFrom` class. |