summaryrefslogtreecommitdiffstats
path: root/tests/test_ipalib/test_plugable.py
diff options
context:
space:
mode:
authorJason Gerard DeRose <jderose@redhat.com>2008-12-21 17:12:00 -0700
committerJason Gerard DeRose <jderose@redhat.com>2008-12-21 17:12:00 -0700
commit4390523b7f854cefcb91843e1df3ca7575d43fea (patch)
tree6f3fddfa3b78dc425683cab1afe28b33ca6f0175 /tests/test_ipalib/test_plugable.py
parentb71d1e6b6f7d2ab31f26c21e4246056a808766c0 (diff)
downloadfreeipa-4390523b7f854cefcb91843e1df3ca7575d43fea.tar.gz
freeipa-4390523b7f854cefcb91843e1df3ca7575d43fea.tar.xz
freeipa-4390523b7f854cefcb91843e1df3ca7575d43fea.zip
Improved Plugin.call() method and added its unit test
Diffstat (limited to 'tests/test_ipalib/test_plugable.py')
-rw-r--r--tests/test_ipalib/test_plugable.py12
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):
"""