From 4390523b7f854cefcb91843e1df3ca7575d43fea Mon Sep 17 00:00:00 2001 From: Jason Gerard DeRose Date: Sun, 21 Dec 2008 17:12:00 -0700 Subject: Improved Plugin.call() method and added its unit test --- tests/test_ipalib/test_plugable.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') 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): """ -- cgit