add repr to proc

This commit is contained in:
Harry
2014-11-04 11:32:28 +00:00
parent acfae7ac2a
commit d2bd3da8ea
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -79,6 +79,9 @@ class Process(object):
return Chain([self, other])
def __repr__(self):
return '<Process: {command}>'.format(command=self.command)
class Chain(object):
+4
View File
@@ -7,6 +7,10 @@ TEST_DIR = os.path.abspath(os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'test_data'
))
def tests_repr():
p = Process('foo')
assert repr(p) == '<Process: foo>'
def test_single_proc():
ls = Process('ls {test_dir}'.format(test_dir=TEST_DIR))