コード例 #1
0
 def listMethods(self, *params):
     """list methods for XML-RPC introspection"""
     if params:
         raise errors.ZeroArgumentError(name='system.listMethods')
     return (tuple(unicode(cmd.name) for cmd in self.Command()
                   if cmd is self.Command[cmd.name]) +
             tuple(unicode(name) for name in self._system_commands))
コード例 #2
0
ファイル: test_ping_plugin.py プロジェクト: jtux270/translate
class test_ping(Declarative):

    tests = [
        dict(
            desc='Ping the server',
            command=('ping', [], {}),
            expected=dict(
                summary=Fuzzy('IPA server version .*. API version .*')),
        ),
        dict(
            desc='Try to ping with an argument',
            command=('ping', ['bad_arg'], {}),
            expected=errors.ZeroArgumentError(name='ping'),
        ),
        dict(
            desc='Try to ping with an option',
            command=('ping', [], dict(bad_arg=True)),
            expected=errors.OptionError(_('Unknown option: %(option)s'),
                                        option='bad_arg'),
        ),
    ]
コード例 #3
0
 def test_ping_with_argument(self):
     """Try to ping with an argument."""
     with raises_exact(errors.ZeroArgumentError(name='ping')):
         self.tracker.run_command('ping', ['argument'])