comparison tests/doctest.txt @ 10:d1f090c5f291

lets make some more tests
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 08 Jul 2011 13:23:47 -0700
parents aa673036ecc1
children f522620c6a78
comparison
equal deleted inserted replaced
9:aa673036ecc1 10:d1f090c5f291
17 >>> packages = [os.path.join(here, i) for i in 'packageB', 'packageA'] 17 >>> packages = [os.path.join(here, i) for i in 'packageB', 'packageA']
18 >>> carton.main(['foo'] + packages) 18 >>> carton.main(['foo'] + packages)
19 >>> os.listdir('.') 19 >>> os.listdir('.')
20 ['foo.py'] 20 ['foo.py']
21 21
22 Invoke the foo.py it creates::
23
24 >>> import subprocess
25 >>> subprocess.call([python, 'foo.py'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
26 0
27 >>> sorted(os.listdir('.'))
28 ['foo', 'foo.py']
29 >>> os.path.isdir('foo')
30 True
31 >>> sorted(os.listdir(os.path.join('foo', 'src')))
32 ['packageA', 'packageB']
33
22 Clean up:: 34 Clean up::
23 35
24 >>> import shutil 36 >>> import shutil
25 >>> shutil.rmtree(directory) 37 >>> shutil.rmtree(directory)