Mercurial > hg > carton
annotate tests/doctest.txt @ 8:5905459d4ebe
now have a passing if somewhat rudimentary test
| author | Jeff Hammel <jhammel@mozilla.com> |
|---|---|
| date | Fri, 08 Jul 2011 11:06:08 -0700 |
| parents | 111ffe84f66a |
| children | aa673036ecc1 |
| 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 |
| 14 Run some tests:: | |
| 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) |
