From 13ff27e9ecd06cf893abf12f40051e54639be47d Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Fri, 13 Mar 2009 00:53:05 -0600 Subject: Fixed Executioner.execute() so that its 'name' argument doesn't conflict with a param called 'name' (which is a valid param name) --- tests/test_ipalib/test_backend.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/test_ipalib') 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' -- cgit