UnitTests

* Taskd and Taskw classes for testing are now available
 * Testing of server and client can now be performed.
 * The newer test wrappers will eventually replace the BaseTest class
This commit is contained in:
Renato Alves 2014-07-06 02:03:04 +01:00
parent 733561863e
commit 715a414abd
4 changed files with 318 additions and 17 deletions

View file

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
class CommandError(Exception):
def __init__(self, cmd, code, out, err, msg=None):
if msg is None:
self.msg = ("Command '{0}' finished with unexpected exit code "
"'{1}':\nStdout: '{2}'\nStderr: '{3}'")
else:
self.msg = msg
self.cmd = cmd
self.out = out
self.err = err
self.code = code
def __str__(self):
return self.msg.format(self.cmd, self.code, self.out, self.err)
# vim: ai sts=4 et sw=4