diff options
author | Jan Cholasta <jcholast@redhat.com> | 2011-06-21 14:07:19 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-07-15 02:21:23 -0400 |
commit | b203756a886f8d3a16079bea7c047e595b221121 (patch) | |
tree | fd0842cffdd0309e06e4fbdf44175e7b64c30f10 /tests | |
parent | d802aa57f16e3267b4db739721a56e041e5f888e (diff) | |
download | freeipa-b203756a886f8d3a16079bea7c047e595b221121.tar.gz freeipa-b203756a886f8d3a16079bea7c047e595b221121.tar.xz freeipa-b203756a886f8d3a16079bea7c047e595b221121.zip |
Add ability to specify DNS reverse zone name by IP network address.
In order for this to work, chaining of parameters through
default_from is made possible.
ticket 1474
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ipalib/test_frontend.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_frontend.py b/tests/test_ipalib/test_frontend.py index 7381d9ad8..0f6aecb3d 100644 --- a/tests/test_ipalib/test_frontend.py +++ b/tests/test_ipalib/test_frontend.py @@ -418,6 +418,33 @@ class test_Command(ClassChecker): """ # FIXME: Add an updated unit tests for get_default() + def test_default_from_chaining(self): + """ + Test chaining of parameters through default_from. + """ + class my_cmd(self.cls): + takes_options = ( + Str('option0'), + Str('option1', default_from=lambda option0: option0), + Str('option2', default_from=lambda option1: option1), + ) + + def run(self, *args, **options): + return dict(result=options) + + kw = dict(option0=u'some value') + + (api, home) = create_test_api() + api.finalize() + o = my_cmd() + o.set_api(api) + o.finalize() + e = o(**kw) + assert type(e) is dict + assert 'result' in e + assert 'option2' in e['result'] + assert e['result']['option2'] == u'some value' + def test_validate(self): """ Test the `ipalib.frontend.Command.validate` method. |