summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_backend.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-12-09 09:09:53 -0700
committerJason Gerard DeRose <jderose@redhat.com>2009-12-10 08:29:15 -0700
commitb6e4972e7f6aa08e0392a2cf441b60ab0e7d88b7 (patch)
tree7e5329a51af169ce34a7d275a1bbd63c1e31c026 /tests/test_ipalib/test_backend.py
parentd08b8858ddc3bf6265f6ea8acae6661b9fff5112 (diff)
downloadfreeipa-b6e4972e7f6aa08e0392a2cf441b60ab0e7d88b7.tar.gz
freeipa-b6e4972e7f6aa08e0392a2cf441b60ab0e7d88b7.tar.xz
freeipa-b6e4972e7f6aa08e0392a2cf441b60ab0e7d88b7.zip
Take 2: Extensible return values and validation; steps toward a single output_for_cli(); enable more webUI stuff
Diffstat (limited to 'tests/test_ipalib/test_backend.py')
-rw-r--r--tests/test_ipalib/test_backend.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py
index 9ddbbf252..3c29ee35f 100644
--- a/tests/test_ipalib/test_backend.py
+++ b/tests/test_ipalib/test_backend.py
@@ -176,7 +176,7 @@ class test_Executioner(ClassChecker):
takes_options = ('option1?', 'option2?')
def execute(self, *args, **options):
assert type(args[1]) is tuple
- return args + (options,)
+ return dict(result=args + (options,))
api.register(echo)
class good(Command):
@@ -198,7 +198,7 @@ class test_Executioner(ClassChecker):
"""
takes_options = 'name'
def execute(self, **options):
- return options['name'].upper()
+ return dict(result=options['name'].upper())
api.register(with_name)
api.finalize()
@@ -222,13 +222,17 @@ class test_Executioner(ClassChecker):
conn = Connection('The connection.', Disconnect())
context.someconn = conn
- assert o.execute('echo', arg1, arg2, **options) == (arg1, arg2, options)
+ assert o.execute('echo', arg1, arg2, **options) == dict(
+ result=(arg1, arg2, options)
+ )
assert conn.disconnect.called is True # Make sure destroy_context() was called
assert context.__dict__.keys() == []
conn = Connection('The connection.', Disconnect())
context.someconn = conn
- assert o.execute('echo', *args, **options) == (arg1, arg2, options)
+ assert o.execute('echo', *args, **options) == dict(
+ result=(arg1, arg2, options)
+ )
assert conn.disconnect.called is True # Make sure destroy_context() was called
assert context.__dict__.keys() == []
@@ -251,4 +255,4 @@ class test_Executioner(ClassChecker):
# Test with option 'name':
conn = Connection('The connection.', Disconnect())
context.someconn = conn
- assert o.execute('with_name', name=u'test') == u'TEST'
+ assert o.execute('with_name', name=u'test') == dict(result=u'TEST')