Mercurial > hg > carton
comparison 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 |
comparison
equal
deleted
inserted
replaced
7:111ffe84f66a | 8:5905459d4ebe |
---|---|
2 =========== | 2 =========== |
3 | 3 |
4 The obligatory imports: | 4 The obligatory imports: |
5 | 5 |
6 >>> import carton | 6 >>> import carton |
7 >>> import os | |
7 | 8 |
8 Make a temporary directory:: | 9 Make a temporary directory:: |
9 | 10 |
10 >>> import tempfile | 11 >>> import tempfile |
11 >>> directory = tempfile.mkdtemp() | 12 >>> directory = tempfile.mkdtemp() |
12 | 13 |
13 Run some tests:: | 14 Run some tests:: |
14 | 15 |
15 >>> 1 == 1 | 16 >>> os.chdir(directory) |
16 True | 17 >>> packages = [os.path.join(here, i) for i in 'packageB', 'packageA'] |
18 >>> carton.main(['foo'] + packages) | |
19 >>> os.listdir('.') | |
20 ['foo.py'] | |
17 | 21 |
18 Clean up:: | 22 Clean up:: |
19 | 23 |
20 >>> import shutil | 24 >>> import shutil |
21 >>> shutil.rmtree(directory) | 25 >>> shutil.rmtree(directory) |