From 57ec5f4cc26e2c4fcb5e6a538d1179b43f963572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Torres=20Mor=C3=AD=C3=B1igo?= Date: Fri, 4 Dec 2020 00:38:09 +0100 Subject: [PATCH] ipatests: test that trailing/leading whitespaces in passwords are allowed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- ipatests/test_ipalib/test_parameters.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipatests/test_ipalib/test_parameters.py b/ipatests/test_ipalib/test_parameters.py index d9510974d..d71faf4f7 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.