mirror of
https://github.com/kennethreitz-archive/procs.git
synced 2026-06-05 23:30:18 +00:00
handle case where stdout is the empty string
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user