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 <mkosek@redhat.com>
This commit is contained in:
Petr Viktorin 2014-06-19 19:06:19 +02:00
parent f486d23ad6
commit 013bf3d4e2
4 changed files with 18 additions and 18 deletions

View File

@ -105,15 +105,11 @@ class Env(object):
u'false' u'false'
If an ``str`` value looks like an integer, it's automatically converted to 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 the ``int`` type.
number, it's automatically converted to the ``float`` type. For example:
>>> env.lucky = '7' >>> env.lucky = '7'
>>> env.lucky >>> env.lucky
7 7
>>> env.three_halves = '1.5'
>>> env.three_halves
1.5
Leading and trailing white-space is automatically stripped from ``str`` Leading and trailing white-space is automatically stripped from ``str``
values. For example: values. For example:

View File

@ -466,9 +466,9 @@ class test_old_permission(Declarative):
summary=u'2 permissions matched', summary=u'2 permissions matched',
result=[ result=[
{ {
'dn': DN(('cn','Modify Group Password Policy'), 'dn': DN(('cn', 'System: Modify Group Password Policy'),
api.env.container_permission, api.env.basedn), 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'), 'dn': DN(('cn', 'System: Read Group Password Policy'),
@ -796,10 +796,10 @@ class test_old_permission(Declarative):
summary=u'1 permission matched', summary=u'1 permission matched',
result=[ 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), api.env.container_permission, api.env.basedn),
'cn': [u'Add user to default group'], 'cn': [u'System: Add User to default group'],
'objectclass': objectclasses.system_permission, 'objectclass': objectclasses.permission,
'member_privilege': [u'User Administrators'], 'member_privilege': [u'User Administrators'],
'attrs': [u'member'], 'attrs': [u'member'],
'targetgroup': u'ipausers', 'targetgroup': u'ipausers',
@ -807,7 +807,9 @@ class test_old_permission(Declarative):
'permissions': [u'write'], 'permissions': [u'write'],
'ipapermbindruletype': [u'permission'], 'ipapermbindruletype': [u'permission'],
'ipapermtarget': [DN('cn=ipausers', groups_dn)], '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'],
} }
], ],
), ),

View File

@ -758,9 +758,9 @@ class test_permission(Declarative):
summary=u'2 permissions matched', summary=u'2 permissions matched',
result=[ result=[
{ {
'dn': DN(('cn','Modify Group Password Policy'), 'dn': DN(('cn', 'System: Modify Group Password Policy'),
api.env.container_permission, api.env.basedn), 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'), 'dn': DN(('cn', 'System: Read Group Password Policy'),
@ -1193,10 +1193,10 @@ class test_permission(Declarative):
summary=u'1 permission matched', summary=u'1 permission matched',
result=[ 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), api.env.container_permission, api.env.basedn),
'cn': [u'Add user to default group'], 'cn': [u'System: Add User to default group'],
'objectclass': objectclasses.system_permission, 'objectclass': objectclasses.permission,
'member_privilege': [u'User Administrators'], 'member_privilege': [u'User Administrators'],
'attrs': [u'member'], 'attrs': [u'member'],
'targetgroup': [u'ipausers'], 'targetgroup': [u'ipausers'],
@ -1206,7 +1206,9 @@ class test_permission(Declarative):
'ipapermtarget': [DN( 'ipapermtarget': [DN(
'cn=ipausers', api.env.container_group, 'cn=ipausers', api.env.container_group,
api.env.basedn)], api.env.basedn)],
'ipapermlocation': [api.env.basedn], 'ipapermlocation': [groups_dn],
'ipapermdefaultattr': [u'member'],
'ipapermissiontype': [u'V2', u'MANAGED', u'SYSTEM'],
} }
], ],
), ),

View File

@ -70,7 +70,7 @@ class test_realmdomains(Declarative):
u'(targetfilter = "(objectclass=domainrelatedobject)")' u'(targetfilter = "(objectclass=domainrelatedobject)")'
u'(version 3.0;acl ' u'(version 3.0;acl '
u'"permission:System: Read Realm Domains";' u'"permission:System: Read Realm Domains";'
u'allow (read,compare,search) ' u'allow (compare,read,search) '
u'userdn = "ldap:///all";)' u'userdn = "ldap:///all";)'
], ],
), ),