Change Password param so (password, confirm_password) can be passed to _convert_scalar()

This commit is contained in:
Jason Gerard DeRose
2009-10-16 02:22:39 -06:00
parent a3a0c0ae33
commit b35849b47d
3 changed files with 29 additions and 0 deletions

View File

@@ -1065,6 +1065,17 @@ class test_Password(ClassChecker):
assert o.pattern is None
assert o.password is True
def test_convert_scalar(self):
"""
Test the `ipalib.parameters.Password._convert_scalar` method.
"""
o = self.cls('my_password')
e = raises(errors.PasswordMismatch, o._convert_scalar, [u'one', u'two'])
assert e.name == 'my_password'
assert e.index is None
assert o._convert_scalar([u'one', u'one']) == u'one'
assert o._convert_scalar(u'one') == u'one'
class test_StrEnum(ClassChecker):
"""