Hi,

here's a patch that adds a few comments to stageuser tests in order to allow easier determining of a problem when tests fail.


Lenka
From a1ec552f27eeb05f5f9c41d59e076aa6ef7601db Mon Sep 17 00:00:00 2001
From: Lenka Doudova <ldoud...@redhat.com>
Date: Wed, 18 Nov 2015 09:11:29 +0100
Subject: [PATCH] Adding comments in stageuser plugin tests.

Adding comments that should allow better orientation in the test_create_attr method. Original description was insufficient for identification of problem in case of failed tests.

Adding comments in stageuser plugin tests

Adding comments that should allow better orientation in the test_create_attr method. Original description was insufficient for identification of problem in case of failed tests.
---
 ipatests/test_xmlrpc/test_stageuser_plugin.py | 62 +++++++++++++++------------
 1 file changed, 34 insertions(+), 28 deletions(-)

diff --git a/ipatests/test_xmlrpc/test_stageuser_plugin.py b/ipatests/test_xmlrpc/test_stageuser_plugin.py
index 43c59b7c7ec2902064fc363c66e98cc98e8b9e17..78244f30b57986a9d45a272f15458d438e5cb6b0 100644
--- a/ipatests/test_xmlrpc/test_stageuser_plugin.py
+++ b/ipatests/test_xmlrpc/test_stageuser_plugin.py
@@ -54,33 +54,33 @@ sshpubkeyfp = (u'13:67:6B:BF:4E:A2:05:8E:AE:25:8B:A1:31:DE:6F:1B '
                'public key test (ssh-rsa)')
 
 options_ok = [
-    {u'cn': u'name'},
-    {u'initials': u'in'},
-    {u'displayname': u'display'},
-    {u'homedirectory': u'/home/homedir'},
-    {u'gecos': u'gecos'},
-    {u'loginshell': u'/bin/shell'},
-    {u'mail': u'email@email.email'},
-    {u'title': u'newbie'},
-    {u'krbprincipalname': u'kerberos@%s' % api.env.realm},
-    {u'krbprincipalname': u'KERBEROS@%s' % api.env.realm},
-    {u'street': u'first street'},
-    {u'l': u'prague'},
-    {u'st': u'czech'},
-    {u'postalcode': u'12345'},
-    {u'telephonenumber': u'123456789'},
-    {u'facsimiletelephonenumber': u'123456789'},
-    {u'mobile': u'123456789'},
-    {u'pager': u'123456789'},
-    {u'ou': u'engineering'},
-    {u'carlicense': u'abc1234'},
-    {u'ipasshpubkey': sshpubkey},
-    {u'manager': u'auser1'},
-    {u'uidnumber': uid},
-    {u'gidnumber': gid},
-    {u'uidnumber': uid, u'gidnumber': gid},
-    {u'userpassword': u'Secret123'},
-    {u'random': True},
+    {u'cn': u'name'},  # 1
+    {u'initials': u'in'},  # 2
+    {u'displayname': u'display'},  # 3
+    {u'homedirectory': u'/home/homedir'},  # 4
+    {u'gecos': u'gecos'},  # 5
+    {u'loginshell': u'/bin/shell'},  # 6
+    {u'mail': u'email@email.email'},  # 7
+    {u'title': u'newbie'},  # 8
+    {u'krbprincipalname': u'kerberos@%s' % api.env.realm},  # 9
+    {u'krbprincipalname': u'KERBEROS@%s' % api.env.realm},  # 10
+    {u'street': u'first street'},  # 11
+    {u'l': u'prague'},  # 12
+    {u'st': u'czech'},  # 13
+    {u'postalcode': u'12345'},  # 14
+    {u'telephonenumber': u'123456789'},  # 15
+    {u'facsimiletelephonenumber': u'123456789'},  # 16
+    {u'mobile': u'123456789'},  # 17
+    {u'pager': u'123456789'},  # 18
+    {u'ou': u'engineering'},  # 19
+    {u'carlicense': u'abc1234'},  # 20
+    {u'ipasshpubkey': sshpubkey},  # 21
+    {u'manager': u'auser1'},  # 22
+    {u'uidnumber': uid},  # 23
+    {u'gidnumber': gid},  # 24
+    {u'uidnumber': uid, u'gidnumber': gid},  # 25
+    {u'userpassword': u'Secret123'},  # 26
+    {u'random': True},  # 27
     ]
 
 
@@ -461,7 +461,13 @@ class TestStagedUser(XMLRPC_test):
 
     def test_create_attr(self, stageduser2, user, user6):
         """ Tests creating a user with various valid attributes listed
-        in 'options_ok' list"""
+        in 'options_ok' list
+        Should this test fail, a message like the following appears:
+        ...::test_create_attr[stageduser2XX] FAILED
+        where the 'XX' specifies option with which the 'ipa stageuser-add'
+        command was performed. The options are listed and numbered
+        accordingly in 'options_ok' list.
+        """
         # create staged user with specified parameters
         user.ensure_exists()  # necessary for manager test
         stageduser2.ensure_missing()
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to