#5115 ipatests: registering plugins via API.register/Registrar class doesn't work
Closed: Fixed None Opened 8 years ago by mkubik.

The way of registering plugins into an API object described in the ipalib package doesn't work.

Output from a failed test:

______________________ [doctest] ipalib.frontend.Command _______________________
379     namespace. For example:
380 
381     >>> from ipalib import create_api
382     >>> api = create_api()
383     >>> class my_command(Command):
384     ...     pass
385     ...
386     >>> api.register(my_command)
387     >>> api.finalize()
388     >>> list(api.Command)
Expected:
    ['my_command']
Got:
    []

/local/mkubik/freeipa/ipalib/frontend.py:388: DocTestFailure

I'm not sure if this happens only in 'dummy' mode of the api. I will investigate further.


The changes made to the API object and plugin collecting made the examples in ipalib modules outdated. When run with doctest, these fail.

         >>> from ipalib import Command, create_api
         >>> api = create_api()
         >>> class my_command(Command):
         ...     pass
         ...
         >>> api.register(my_command)
         >>> api.finalize()

These examples should now use the {{{api.add_plugin}}} method.

Based on an offline discussion with Jan Cholasta, I'm changing this to be a problem with tests.

master:

  • 15a4c0d ipalib, ipaserver: fix incorrect API.register calls in docstrings

Metadata Update from @mkubik:
- Issue assigned to jcholast
- Issue set to the milestone: FreeIPA 4.4

7 years ago

Login to comment on this ticket.

Metadata