Commit 4cc943af authored by jim's avatar jim

Changed the way we run system commands in tests to get more

deterministic output by outputing all of standard output followed
by all of standard error.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@76843 62d5b8a3-27da-0310-9561-8e5933582275
parent 11ab11d9
......@@ -72,27 +72,26 @@ supply some input:
... p self.options.keys()
... q
... """),
Develop: '/sample-buildout/recipes'
Develop: '/tmp/tmp6YPc7CbuildoutSetUp/_TEST_/sample-buildout/recipes'
Installing data-dir.
While:
> /home/jim/p/zc/buildout/trunk/src/zc/buildout/buildout.py(925)__getitem__()
-> raise MissingOption("Missing option: %s:%s" % (self.name, key))
(Pdb) > /tmp/tmp6YPc7CbuildoutSetUp/_TEST_/sample-buildout/recipes/mkdir.py(14)install()
-> directory = self.options['directory']
(Pdb) ['path', 'recipe']
(Pdb) While:
Installing data-dir.
Traceback (most recent call last):
File "/zc/buildout/buildout.py", line 1294, in main
File "/zc/buildout/buildout.py", line 1352, in main
getattr(buildout, command)(args)
File "/zc/buildout/buildout.py", line 371, in install
File "/zc/buildout/buildout.py", line 383, in install
installed_files = self[part]._call(recipe.install)
File "/zc/buildout/buildout.py", line 929, in _call
File "/zc/buildout/buildout.py", line 961, in _call
return f()
File "/sample-buildout/recipes/mkdir.py", line 14, in install
directory = self.options['directory']
File "/zc/buildout/buildout.py", line 895, in __getitem__
File "/zc/buildout/buildout.py", line 925, in __getitem__
raise MissingOption("Missing option: %s:%s" % (self.name, key))
MissingOption: Missing option: data-dir:directory
<BLANKLINE>
Starting pdb:
> /Users/jim/p/buildout/trunk/src/zc/buildout/buildout.py(895)__getitem__()
-> raise MissingOption("Missing option: %s:%s" % (self.name, key))
(Pdb) > /sample-buildout/recipes/mkdir.py(14)install()
-> directory = self.options['directory']
(Pdb) ['path', 'recipe']
(Pdb)
......@@ -73,12 +73,16 @@ def write(dir, *args):
fsync(f.fileno())
f.close()
def system(command, input=''):
i, o = os.popen4(command)
i, o, e = os.popen3(command)
if input:
i.write(input)
i.close()
return o.read()
result = o.read()+e.read()
o.close()
e.close()
return result
def get(url):
return urllib2.urlopen(url).read()
......
......@@ -1674,15 +1674,15 @@ def install_source_dist_with_bad_py():
>>> print system(buildout), # doctest: +NORMALIZE_WHITESPACE
Installing eggs.
Getting distribution for 'badegg'.
Got badegg 1.
Installing bo.
Generated script '/sample-buildout/bin/bo'.
File "build/bdist.linux-i686/egg/badegg/scripts/one.py", line 2
return 1
SyntaxError: 'return' outside function
File "/sample-buildout/eggs/badegg-1-py2.4.egg/badegg/scripts/one.py", line 2
File "/sample-buildout/eggs/tmppsHubz/badegg-1-py2.4.egg/badegg/scripts/one.py", line 2
return 1
SyntaxError: 'return' outside function
Got badegg 1.
Installing bo.
Generated script '/sample-buildout/bin/bo'.
>>> ls('eggs') # doctest: +ELLIPSIS
d badegg-1-py2.4.egg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment