summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_frontend.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-11-18 16:29:08 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-11-18 16:29:08 -0700
commit500b8166811e39ac63bdbaee8dcf01eb0643d868 (patch)
treec0003fa8b643d9e824d70ccf017725f3463e61a9 /tests/test_ipalib/test_frontend.py
parent4afee15d4b523a641552bee9993882bb1ae6e2cc (diff)
downloadfreeipa-500b8166811e39ac63bdbaee8dcf01eb0643d868.tar.gz
freeipa-500b8166811e39ac63bdbaee8dcf01eb0643d868.tar.xz
freeipa-500b8166811e39ac63bdbaee8dcf01eb0643d868.zip
Added unit test for Param.ispassword() method
Diffstat (limited to 'tests/test_ipalib/test_frontend.py')
-rw-r--r--tests/test_ipalib/test_frontend.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py
index 44d8e54c..87296705 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.