handle case where stdout is the empty string

This commit is contained in:
Harry
2014-11-04 09:28:59 +00:00
parent d4dba5602b
commit 7dda975c05
2 changed files with 7 additions and 2 deletions
+1 -2
View File
@@ -30,9 +30,8 @@ class Process(object):
@property
def stdout(self):
if self._stdout:
if self._stdout is not None:
return self._stdout
return 'stdout'
@property
def stderr(self):
+6
View File
@@ -15,6 +15,12 @@ def test_single_proc():
assert ls.stdout == u'file1\nfile2\nfile3\n'
def test_empty_output():
cat = Process('cat /dev/null')
cat.run()
assert cat.stdout == u''
def test_returncode():
assert not os.path.exists('/bin/nosuchcommand')