From d2bd3da8ea172554de54aaf32385ec0990476741 Mon Sep 17 00:00:00 2001 From: Harry Date: Tue, 4 Nov 2014 11:32:28 +0000 Subject: [PATCH] add repr to proc --- procs.py | 3 +++ tests/test_process.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/procs.py b/procs.py index 4c0e362..317aee2 100644 --- a/procs.py +++ b/procs.py @@ -79,6 +79,9 @@ class Process(object): return Chain([self, other]) + def __repr__(self): + return ''.format(command=self.command) + class Chain(object): diff --git a/tests/test_process.py b/tests/test_process.py index 5ebe897..a166045 100644 --- a/tests/test_process.py +++ b/tests/test_process.py @@ -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) == '' + def test_single_proc(): ls = Process('ls {test_dir}'.format(test_dir=TEST_DIR))