mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix non XML-RPC tests
This commit is contained in:
parent
eab04c9d09
commit
47f2e618f9
@ -293,15 +293,6 @@ class textui(backend.Backend):
|
||||
one_value_per_line=True):
|
||||
"""
|
||||
Print an ldap entry dict.
|
||||
|
||||
For example:
|
||||
|
||||
>>> entry = dict(sn='Last', givenname='First', uid='flast')
|
||||
>>> ui = textui()
|
||||
>>> ui.print_entry(entry)
|
||||
givenname: First
|
||||
sn: Last
|
||||
uid: flast
|
||||
"""
|
||||
assert isinstance(entry, dict)
|
||||
assert isinstance(attr_map, dict)
|
||||
|
@ -76,7 +76,7 @@ us:
|
||||
>>> list(api.Command.user_add.args)
|
||||
['login']
|
||||
>>> list(api.Command.user_add.options)
|
||||
['first', 'last']
|
||||
['first', 'last', 'all', 'raw']
|
||||
|
||||
Notice that ``'ipauniqueid'`` isn't included in the options for our ``user_add``
|
||||
plugin. This is because of the ``'no_create'`` flag we used when defining the
|
||||
@ -94,7 +94,7 @@ class created them for us:
|
||||
>>> list(api.Command.user_show.args)
|
||||
['login']
|
||||
>>> list(api.Command.user_show.options)
|
||||
[]
|
||||
['all', 'raw']
|
||||
|
||||
As you can see, `Retrieve` plugins take a single argument (the primary key) and
|
||||
no options. If needed, you can still specify options for your `Retrieve` plugin
|
||||
|
@ -74,12 +74,12 @@ class test_Create(CrudChecker):
|
||||
"""
|
||||
api = self.get_api()
|
||||
assert list(api.Method.user_verb.options) == \
|
||||
['givenname', 'sn', 'initials']
|
||||
['givenname', 'sn', 'initials', 'all', 'raw']
|
||||
for param in api.Method.user_verb.options():
|
||||
assert param.required is True
|
||||
api = self.get_api(options=('extra?',))
|
||||
assert list(api.Method.user_verb.options) == \
|
||||
['givenname', 'sn', 'initials', 'extra']
|
||||
['givenname', 'sn', 'initials', 'extra', 'all', 'raw']
|
||||
assert api.Method.user_verb.options.extra.required is False
|
||||
|
||||
|
||||
@ -104,9 +104,12 @@ class test_Update(CrudChecker):
|
||||
"""
|
||||
api = self.get_api()
|
||||
assert list(api.Method.user_verb.options) == \
|
||||
['givenname', 'initials', 'uidnumber']
|
||||
['givenname', 'initials', 'uidnumber', 'all', 'raw']
|
||||
for param in api.Method.user_verb.options():
|
||||
assert param.required is False
|
||||
if param.name in ['all', 'raw']:
|
||||
assert param.required is True
|
||||
else:
|
||||
assert param.required is False
|
||||
|
||||
|
||||
class test_Retrieve(CrudChecker):
|
||||
@ -129,8 +132,7 @@ class test_Retrieve(CrudChecker):
|
||||
Test the `ipalib.crud.Retrieve.get_options` method.
|
||||
"""
|
||||
api = self.get_api()
|
||||
assert list(api.Method.user_verb.options) == []
|
||||
assert len(api.Method.user_verb.options) == 0
|
||||
assert list(api.Method.user_verb.options) == ['all', 'raw']
|
||||
|
||||
|
||||
class test_Delete(CrudChecker):
|
||||
@ -178,9 +180,12 @@ class test_Search(CrudChecker):
|
||||
"""
|
||||
api = self.get_api()
|
||||
assert list(api.Method.user_verb.options) == \
|
||||
['givenname', 'sn', 'uid', 'initials']
|
||||
['givenname', 'sn', 'uid', 'initials', 'all', 'raw']
|
||||
for param in api.Method.user_verb.options():
|
||||
assert param.required is False
|
||||
if param.name in ['all', 'raw']:
|
||||
assert param.required is True
|
||||
else:
|
||||
assert param.required is False
|
||||
|
||||
|
||||
class test_CrudBackend(ClassChecker):
|
||||
|
Loading…
Reference in New Issue
Block a user