From 500b8166811e39ac63bdbaee8dcf01eb0643d868 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Tue, 18 Nov 2008 16:29:08 -0700 Subject: Added unit test for Param.ispassword() method --- tests/test_ipalib/test_frontend.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py index 44d8e54cc..87296705e 100644 --- a/tests/test_ipalib/test_frontend.py +++ b/tests/test_ipalib/test_frontend.py @@ -226,6 +226,22 @@ class test_Param(ClassChecker): assert str(e) == \ 'Param.__init__() takes no such kwargs: another, whatever' + def test_ispassword(self): + """ + Test the `ipalib.frontend.Param.ispassword` method. + """ + name = 'userpassword' + okay = 'password' + nope = ['', 'pass', 'word', 'passwd'] + for flag in nope: + o = self.cls(name, flags=[flag]) + assert o.ispassword() is False + o = self.cls(name, flags=[flag, okay]) + assert o.ispassword() is True + assert self.cls(name).ispassword() is False + assert self.cls(name, flags=[okay]).ispassword() is True + assert self.cls(name, flags=[okay]+nope).ispassword() is True + def test_clone(self): """ Test the `ipalib.frontend.Param.__clone__` method. -- cgit