summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2012-08-31 05:29:32 -0400
committerRob Crittenden <rcritten@redhat.com>2012-09-03 21:47:21 -0400
commit208e6930de94f56264f5964411bbe1b0d6684516 (patch)
treed1db56c2b00d677b6fd6e3954d3cfae9d2785f42 /tests/test_xmlrpc
parentbe8a9e6ddbd16fc4b25a6ab895b047d36f3d608e (diff)
downloadfreeipa.git-208e6930de94f56264f5964411bbe1b0d6684516.tar.gz
freeipa.git-208e6930de94f56264f5964411bbe1b0d6684516.tar.xz
freeipa.git-208e6930de94f56264f5964411bbe1b0d6684516.zip
Sort policies numerically in pwpolicy-find
Password policies in pwpolicy-find are now sorted in the expected numerical manner. Also tweaks one of the unit tests so that it tests this behaviour. https://fedorahosted.org/freeipa/ticket/3039
Diffstat (limited to 'tests/test_xmlrpc')
-rw-r--r--tests/test_xmlrpc/test_pwpolicy_plugin.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_xmlrpc/test_pwpolicy_plugin.py b/tests/test_xmlrpc/test_pwpolicy_plugin.py
index 4f57c23f..3b482ce2 100644
--- a/tests/test_xmlrpc/test_pwpolicy_plugin.py
+++ b/tests/test_xmlrpc/test_pwpolicy_plugin.py
@@ -39,7 +39,7 @@ class test_pwpolicy(XMLRPC_test):
user = u'testuser12'
kw = {'cospriority': 1, 'krbminpwdlife': 30, 'krbmaxpwdlife': 40, 'krbpwdhistorylength': 5, 'krbpwdminlength': 6 }
kw2 = {'cospriority': 2, 'krbminpwdlife': 40, 'krbmaxpwdlife': 60, 'krbpwdhistorylength': 8, 'krbpwdminlength': 9 }
- kw3 = {'cospriority': 3, 'krbminpwdlife': 50, 'krbmaxpwdlife': 30, 'krbpwdhistorylength': 3, 'krbpwdminlength': 4 }
+ kw3 = {'cospriority': 10, 'krbminpwdlife': 50, 'krbmaxpwdlife': 30, 'krbpwdhistorylength': 3, 'krbpwdminlength': 4 }
global_policy = u'global_policy'
def test_1_pwpolicy_add(self):
@@ -177,12 +177,14 @@ class test_pwpolicy(XMLRPC_test):
assert_attr_equal(entry, 'krbmaxpwdlife', '30')
assert_attr_equal(entry, 'krbpwdhistorylength', '3')
assert_attr_equal(entry, 'krbpwdminlength', '4')
- assert_attr_equal(entry, 'cospriority', '3')
+ assert_attr_equal(entry, 'cospriority', '10')
def test_c_pwpolicy_find(self):
"""Test that password policies are sorted and reported properly"""
result = api.Command['pwpolicy_find']()['result']
assert len(result) == 4
+
+ # Test that policies are sorted in numerical order
assert result[0]['cn'] == (self.group,)
assert result[1]['cn'] == (self.group2,)
assert result[2]['cn'] == (self.group3,)