From 013bf3d4e282643ca1c424b4afc42237093ec412 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Thu, 19 Jun 2014 19:06:19 +0200 Subject: [PATCH] Test and docstring fixes The recent conversions to managed permissions left behind a few failing tests. Fix them. Also fix a now incorrect docstring in ipalib.config. Reviewed-By: Martin Kosek --- ipalib/config.py | 6 +----- ipatests/test_xmlrpc/test_old_permission_plugin.py | 14 ++++++++------ ipatests/test_xmlrpc/test_permission_plugin.py | 14 ++++++++------ ipatests/test_xmlrpc/test_realmdomains_plugin.py | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ipalib/config.py b/ipalib/config.py index b12cfd321..e8958205d 100644 --- a/ipalib/config.py +++ b/ipalib/config.py @@ -105,15 +105,11 @@ class Env(object): u'false' If an ``str`` value looks like an integer, it's automatically converted to - the ``int`` type. Likewise, if an ``str`` value looks like a floating-point - number, it's automatically converted to the ``float`` type. For example: + the ``int`` type. >>> env.lucky = '7' >>> env.lucky 7 - >>> env.three_halves = '1.5' - >>> env.three_halves - 1.5 Leading and trailing white-space is automatically stripped from ``str`` values. For example: diff --git a/ipatests/test_xmlrpc/test_old_permission_plugin.py b/ipatests/test_xmlrpc/test_old_permission_plugin.py index 9de397d67..e69c4f824 100644 --- a/ipatests/test_xmlrpc/test_old_permission_plugin.py +++ b/ipatests/test_xmlrpc/test_old_permission_plugin.py @@ -466,9 +466,9 @@ class test_old_permission(Declarative): summary=u'2 permissions matched', result=[ { - 'dn': DN(('cn','Modify Group Password Policy'), + 'dn': DN(('cn', 'System: Modify Group Password Policy'), api.env.container_permission, api.env.basedn), - 'cn': [u'Modify Group Password Policy'], + 'cn': [u'System: Modify Group Password Policy'], }, { 'dn': DN(('cn', 'System: Read Group Password Policy'), @@ -796,10 +796,10 @@ class test_old_permission(Declarative): summary=u'1 permission matched', result=[ { - 'dn': DN(('cn','Add user to default group'), + 'dn': DN(('cn', 'System: Add User to default group'), api.env.container_permission, api.env.basedn), - 'cn': [u'Add user to default group'], - 'objectclass': objectclasses.system_permission, + 'cn': [u'System: Add User to default group'], + 'objectclass': objectclasses.permission, 'member_privilege': [u'User Administrators'], 'attrs': [u'member'], 'targetgroup': u'ipausers', @@ -807,7 +807,9 @@ class test_old_permission(Declarative): 'permissions': [u'write'], 'ipapermbindruletype': [u'permission'], 'ipapermtarget': [DN('cn=ipausers', groups_dn)], - 'subtree': u'ldap:///%s' % api.env.basedn, + 'subtree': u'ldap:///%s' % groups_dn, + 'ipapermdefaultattr': [u'member'], + 'ipapermissiontype': [u'V2', u'MANAGED', u'SYSTEM'], } ], ), diff --git a/ipatests/test_xmlrpc/test_permission_plugin.py b/ipatests/test_xmlrpc/test_permission_plugin.py index a37876bea..feffc2eb1 100644 --- a/ipatests/test_xmlrpc/test_permission_plugin.py +++ b/ipatests/test_xmlrpc/test_permission_plugin.py @@ -758,9 +758,9 @@ class test_permission(Declarative): summary=u'2 permissions matched', result=[ { - 'dn': DN(('cn','Modify Group Password Policy'), + 'dn': DN(('cn', 'System: Modify Group Password Policy'), api.env.container_permission, api.env.basedn), - 'cn': [u'Modify Group Password Policy'], + 'cn': [u'System: Modify Group Password Policy'], }, { 'dn': DN(('cn', 'System: Read Group Password Policy'), @@ -1193,10 +1193,10 @@ class test_permission(Declarative): summary=u'1 permission matched', result=[ { - 'dn': DN(('cn','Add user to default group'), + 'dn': DN(('cn', 'System: Add User to default group'), api.env.container_permission, api.env.basedn), - 'cn': [u'Add user to default group'], - 'objectclass': objectclasses.system_permission, + 'cn': [u'System: Add User to default group'], + 'objectclass': objectclasses.permission, 'member_privilege': [u'User Administrators'], 'attrs': [u'member'], 'targetgroup': [u'ipausers'], @@ -1206,7 +1206,9 @@ class test_permission(Declarative): 'ipapermtarget': [DN( 'cn=ipausers', api.env.container_group, api.env.basedn)], - 'ipapermlocation': [api.env.basedn], + 'ipapermlocation': [groups_dn], + 'ipapermdefaultattr': [u'member'], + 'ipapermissiontype': [u'V2', u'MANAGED', u'SYSTEM'], } ], ), diff --git a/ipatests/test_xmlrpc/test_realmdomains_plugin.py b/ipatests/test_xmlrpc/test_realmdomains_plugin.py index a47fd6b98..ee8057d1d 100644 --- a/ipatests/test_xmlrpc/test_realmdomains_plugin.py +++ b/ipatests/test_xmlrpc/test_realmdomains_plugin.py @@ -70,7 +70,7 @@ class test_realmdomains(Declarative): u'(targetfilter = "(objectclass=domainrelatedobject)")' u'(version 3.0;acl ' u'"permission:System: Read Realm Domains";' - u'allow (read,compare,search) ' + u'allow (compare,read,search) ' u'userdn = "ldap:///all";)' ], ),