summaryrefslogtreecommitdiffstats
path: root/ipalib/tests
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-09-24 06:48:27 +0000
committerJason Gerard DeRose <jderose@redhat.com>2008-09-24 06:48:27 +0000
commite63c462f31bc34c5b19d243492c7644f423d55d0 (patch)
tree438b98e2a8895dcd9ffda75cf63c46041266c112 /ipalib/tests
parent4215da30ad9de6467abe2c56f7a56f73001060b3 (diff)
downloadfreeipa-e63c462f31bc34c5b19d243492c7644f423d55d0.tar.gz
freeipa-e63c462f31bc34c5b19d243492c7644f423d55d0.tar.xz
freeipa-e63c462f31bc34c5b19d243492c7644f423d55d0.zip
335: If Command.__convert_scalar() is called with None, it now returns None instead of raising TypeError
Diffstat (limited to 'ipalib/tests')
-rw-r--r--ipalib/tests/test_frontend.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/ipalib/tests/test_frontend.py b/ipalib/tests/test_frontend.py
index d809d1cf2..e61277973 100644
--- a/ipalib/tests/test_frontend.py
+++ b/ipalib/tests/test_frontend.py
@@ -148,8 +148,7 @@ class test_Param(ClassChecker):
# Scenario 1: multivalue=False
o = self.cls(name, type_)
- e = raises(TypeError, o.convert, None)
- assert str(e) == 'value cannot be None'
+ assert o.convert(None) is None
for value in okay:
new = o.convert(value)
assert new == 7
@@ -163,10 +162,8 @@ class test_Param(ClassChecker):
# Scenario 2: multivalue=True
o = self.cls(name, type_, multivalue=True)
- assert o.convert([]) is None
- for none in [None, (7, None)]:
- e = raises(TypeError, o.convert, none)
- assert str(e) == 'value cannot be None'
+ for none in (None, tuple(), []):
+ assert o.convert(none) is None
for value in okay:
assert o.convert((value,)) == (7,)
assert o.convert([value]) == (7,)