From 57ec5f4cc26e2c4fcb5e6a538d1179b43f963572 Mon Sep 17 00:00:00 2001 From: Antonio Torres Moríñigo Date: Dec 18 2020 14:47:59 +0000 Subject: 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 Reviewed-By: Alexander Bokovoy Reviewed-By: Rob Crittenden --- diff --git a/ipatests/test_ipalib/test_parameters.py b/ipatests/test_ipalib/test_parameters.py index d951097..d71faf4 100644 --- a/ipatests/test_ipalib/test_parameters.py +++ b/ipatests/test_ipalib/test_parameters.py @@ -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.