summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2009-03-13 00:53:05 -0600
committerRob Crittenden <rcritten@redhat.com>2009-03-13 10:31:00 -0400
commit13ff27e9ecd06cf893abf12f40051e54639be47d (patch)
tree7bb11a04aafb41362f14869882c7b4af7d77b103 /tests/test_ipalib
parent588c90d8e604c08604840bd3f41d2a5226154fbe (diff)
downloadfreeipa-13ff27e9ecd06cf893abf12f40051e54639be47d.tar.gz
freeipa-13ff27e9ecd06cf893abf12f40051e54639be47d.tar.xz
freeipa-13ff27e9ecd06cf893abf12f40051e54639be47d.zip
Fixed Executioner.execute() so that its 'name' argument doesn't conflict with a param called 'name' (which is a valid param name)
Diffstat (limited to 'tests/test_ipalib')
-rw-r--r--tests/test_ipalib/test_backend.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_backend.py b/tests/test_ipalib/test_backend.py
index 30928532b..798e93de8 100644
--- a/tests/test_ipalib/test_backend.py
+++ b/tests/test_ipalib/test_backend.py
@@ -192,6 +192,15 @@ class test_Executioner(ClassChecker):
raise ValueError('This is private.')
api.register(bad)
+ class with_name(Command):
+ """
+ Test that a kwarg named 'name' can be used.
+ """
+ takes_options=['name']
+ def execute(self, **options):
+ return options['name'].upper()
+ api.register(with_name)
+
api.finalize()
o = self.cls()
o.set_api(api)
@@ -238,3 +247,8 @@ class test_Executioner(ClassChecker):
e = raises(errors2.InternalError, o.execute, 'bad')
assert conn.disconnect.called is True # Make sure destroy_context() was called
assert context.__dict__.keys() == []
+
+ # Test with option 'name':
+ conn = Connection('The connection.', Disconnect())
+ context.someconn = conn
+ assert o.execute('with_name', name=u'test') == u'TEST'