diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-21 17:12:00 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-12-21 17:12:00 -0700 |
commit | 4390523b7f854cefcb91843e1df3ca7575d43fea (patch) | |
tree | 6f3fddfa3b78dc425683cab1afe28b33ca6f0175 /tests | |
parent | b71d1e6b6f7d2ab31f26c21e4246056a808766c0 (diff) | |
download | freeipa-4390523b7f854cefcb91843e1df3ca7575d43fea.tar.gz freeipa-4390523b7f854cefcb91843e1df3ca7575d43fea.tar.xz freeipa-4390523b7f854cefcb91843e1df3ca7575d43fea.zip |
Improved Plugin.call() method and added its unit test
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_ipalib/test_plugable.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_ipalib/test_plugable.py b/tests/test_ipalib/test_plugable.py index 21c712809..b381675b6 100644 --- a/tests/test_ipalib/test_plugable.py +++ b/tests/test_ipalib/test_plugable.py @@ -452,6 +452,18 @@ class test_Plugin(ClassChecker): o.finalize() assert o.__islocked__() + def test_call(self): + """ + Test the `ipalib.plugable.Plugin.call` method. + """ + o = self.cls() + o.call('/bin/true') is None + e = raises(errors.SubprocessError, o.call, '/bin/false') + assert str(e) == 'return code %d from %r' % (1, ('/bin/false',)) + assert e.returncode == 1 + assert e.argv == ('/bin/false',) + + class test_PluginProxy(ClassChecker): """ |