Mercurial > hg > carton
annotate tests/doctest.txt @ 9:aa673036ecc1
correct string
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 08 Jul 2011 13:10:20 -0700 |
parents | 5905459d4ebe |
children | d1f090c5f291 |
rev | line source |
---|---|
5 | 1 Test carton |
2 =========== | |
3 | |
4 The obligatory imports: | |
5 | |
6 >>> import carton | |
8
5905459d4ebe
now have a passing if somewhat rudimentary test
Jeff Hammel <jhammel@mozilla.com>
parents:
7
diff
changeset
|
7 >>> import os |
7 | 8 |
9 Make a temporary directory:: | |
10 | |
5 | 11 >>> import tempfile |
7 | 12 >>> directory = tempfile.mkdtemp() |
5 | 13 |
9 | 14 Invoke carton:: |
5 | 15 |
8
5905459d4ebe
now have a passing if somewhat rudimentary test
Jeff Hammel <jhammel@mozilla.com>
parents:
7
diff
changeset
|
16 >>> os.chdir(directory) |
5905459d4ebe
now have a passing if somewhat rudimentary test
Jeff Hammel <jhammel@mozilla.com>
parents:
7
diff
changeset
|
17 >>> packages = [os.path.join(here, i) for i in 'packageB', 'packageA'] |
5905459d4ebe
now have a passing if somewhat rudimentary test
Jeff Hammel <jhammel@mozilla.com>
parents:
7
diff
changeset
|
18 >>> carton.main(['foo'] + packages) |
5905459d4ebe
now have a passing if somewhat rudimentary test
Jeff Hammel <jhammel@mozilla.com>
parents:
7
diff
changeset
|
19 >>> os.listdir('.') |
5905459d4ebe
now have a passing if somewhat rudimentary test
Jeff Hammel <jhammel@mozilla.com>
parents:
7
diff
changeset
|
20 ['foo.py'] |
5 | 21 |
7 | 22 Clean up:: |
23 | |
24 >>> import shutil | |
25 >>> shutil.rmtree(directory) |