From c303a06a948d1813336161e2546bd85f8edead56 Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Thu, 25 Sep 2008 03:14:12 +0000 Subject: 362: Implemented Get.get_args() and Del.get_args(); added corresponding unit tests --- ipalib/tests/test_crud.py | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'ipalib/tests/test_crud.py') diff --git a/ipalib/tests/test_crud.py b/ipalib/tests/test_crud.py index 41eb8834..2cbf4b16 100644 --- a/ipalib/tests/test_crud.py +++ b/ipalib/tests/test_crud.py @@ -51,9 +51,9 @@ class test_Add(ClassChecker): def test_class(self): assert self.cls.__bases__ == (frontend.Method,) - def test_get_options(self): + def test_options_args(self): """ - Test the `crud.Add.get_options` method. + Test `crud.Add.get_args` and `crud.Add.get_options` methods. """ api = get_api() class user_add(self.cls): @@ -65,7 +65,6 @@ class test_Add(ClassChecker): ['givenname', 'sn', 'uid', 'initials'] - class test_Get(ClassChecker): """ Test the `crud.Get` class. @@ -76,6 +75,18 @@ class test_Get(ClassChecker): def test_class(self): assert self.cls.__bases__ == (frontend.Method,) + def test_options_args(self): + """ + Test `crud.Get.get_args` and `crud.Get.get_options` methods. + """ + api = get_api() + class user_get(self.cls): + pass + api.register(user_get) + api.finalize() + assert list(api.Method.user_get.args) == ['uid'] + assert list(api.Method.user_get.options) == [] + class test_Del(ClassChecker): """ @@ -87,6 +98,18 @@ class test_Del(ClassChecker): def test_class(self): assert self.cls.__bases__ == (frontend.Method,) + def test_options_args(self): + """ + Test `crud.Del.get_args` and `crud.Del.get_options` methods. + """ + api = get_api() + class user_del(self.cls): + pass + api.register(user_del) + api.finalize() + assert list(api.Method.user_del.args) == ['uid'] + assert list(api.Method.user_del.options) == [] + class test_Mod(ClassChecker): """ -- cgit