From 55ba8e9d0b86bf25a2cbb7a3a603d796e7a2be2b Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 25 Sep 2008 03:47:22 +0000 Subject: 365: Implemented find.get_args(), find.get_options(); added corresponding unit tests --- ipalib/tests/test_crud.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ipalib/tests') diff --git a/ipalib/tests/test_crud.py b/ipalib/tests/test_crud.py index 3fcef2c7..8b1e8a86 100644 --- a/ipalib/tests/test_crud.py +++ b/ipalib/tests/test_crud.py @@ -149,3 +149,19 @@ class test_Find(ClassChecker): def test_class(self): assert self.cls.__bases__ == (frontend.Method,) + + def test_options_args(self): + """ + Test `crud.Find.get_args` and `crud.Find.get_options` methods. + """ + api = get_api() + class user_find(self.cls): + pass + api.register(user_find) + api.finalize() + assert list(api.Method.user_find.args) == ['uid'] + assert api.Method.user_find.args[0].required is True + assert list(api.Method.user_find.options) == \ + ['givenname', 'sn', 'initials'] + for param in api.Method.user_find.options(): + assert param.required is False -- cgit