mirror of
https://github.com/kennethreitz-archive/procs.git
synced 2026-06-05 23:30:18 +00:00
add repr to proc
This commit is contained in:
@@ -79,6 +79,9 @@ class Process(object):
|
||||
return Chain([self, other])
|
||||
|
||||
|
||||
def __repr__(self):
|
||||
return '<Process: {command}>'.format(command=self.command)
|
||||
|
||||
|
||||
class Chain(object):
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user