ipatests: test that trailing/leading whitespaces in passwords are allowed

Add test to ensure that strings with trailing or leading
whitespaces are allowed as valid passwords.

Signed-off-by: Antonio Torres Moríñigo <atorresm@protonmail.com>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Antonio Torres Moríñigo authored and Alexander Bokovoy committed 2020-12-18 16:47:59 +02:00
1 parent 809d9cb80f
commit 57ec5f4cc2
1 file changed
+6
+6
View File
@@ -346,6 +346,12 @@ class test_Param(ClassChecker):
assert_equal(p.safe_value(value), u'********')
assert p.safe_value(None) is None
def test_password_whitespaces(self):
values = ('Secret123', ' Secret123', 'Secret123 ', ' Secret123 ',)
p = parameters.Password('my_passwd')
for value in values:
assert(p.validate(value)) is None
def test_clone(self):
"""
Test the `ipalib.parameters.Param.clone` method.