diff options
Diffstat (limited to 'ipalib/tests')
-rw-r--r-- | ipalib/tests/test_cli.py | 5 | ||||
-rw-r--r-- | ipalib/tests/test_public.py | 13 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ipalib/tests/test_cli.py b/ipalib/tests/test_cli.py index 2c65bd06..df3f943e 100644 --- a/ipalib/tests/test_cli.py +++ b/ipalib/tests/test_cli.py @@ -75,6 +75,7 @@ class DummyAPI(object): + class test_CLI(ClassChecker): """ Tests the `cli.CLI` class. @@ -117,7 +118,7 @@ class test_CLI(ClassChecker): len(api.Command) == cnt o = self.cls(api) assert o.mcl is None - o.finalize() + o.build_map() assert o.mcl == 6 # len('cmd_99') def test_dict(self): @@ -128,7 +129,7 @@ class test_CLI(ClassChecker): api = DummyAPI(cnt) assert len(api.Command) == cnt o = self.cls(api) - o.finalize() + o.build_map() for cmd in api.Command(): key = cli.to_cli(cmd.name) assert key in o diff --git a/ipalib/tests/test_public.py b/ipalib/tests/test_public.py index 52fb9336..c071832a 100644 --- a/ipalib/tests/test_public.py +++ b/ipalib/tests/test_public.py @@ -707,19 +707,20 @@ class test_Application(ClassChecker): Tests the `public.Application.application` property. """ assert 'application' in self.cls.__public__ # Public + assert 'set_application' in self.cls.__public__ # Public app = 'The external application' class example(self.cls): 'A subclass' for o in (self.cls(), example()): - assert o.application is None - e = raises(TypeError, setattr, o, 'application', None) + assert read_only(o, 'application') is None + e = raises(TypeError, o.set_application, None) assert str(e) == ( '%s.application cannot be None' % o.__class__.__name__ ) - o.application = app - assert o.application is app - e = raises(AttributeError, setattr, o, 'application', app) + o.set_application(app) + assert read_only(o, 'application') is app + e = raises(AttributeError, o.set_application, app) assert str(e) == ( '%s.application can only be set once' % o.__class__.__name__ ) - assert o.application is app + assert read_only(o, 'application') is app |