Mercurial > piecrust2
comparison tests/tmpfs.py @ 674:f987b29d6fab
tests: Add ability to run tests with a theme site.
* Remove automatic creating of `config.yml`.
* Add option to specify `theme_config` in YAML tests.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sun, 06 Mar 2016 23:48:01 -0800 |
parents | d6403c21bdea |
children | 72f17534d58e |
comparison
equal
deleted
inserted
replaced
673:d6403c21bdea | 674:f987b29d6fab |
---|---|
5 import unicodedata | 5 import unicodedata |
6 from .basefs import TestFileSystemBase | 6 from .basefs import TestFileSystemBase |
7 | 7 |
8 | 8 |
9 class TempDirFileSystem(TestFileSystemBase): | 9 class TempDirFileSystem(TestFileSystemBase): |
10 def __init__(self, default_spec=True): | 10 def __init__(self): |
11 self._root = os.path.join( | 11 self._root = os.path.join( |
12 os.path.dirname(__file__), | 12 os.path.dirname(__file__), |
13 '__tmpfs__', | 13 '__tmpfs__', |
14 '%d' % random.randrange(1000)) | 14 '%d' % random.randrange(1000)) |
15 self._done = False | 15 self._done = False |
16 if default_spec: | |
17 self._initDefaultSpec() | |
18 | 16 |
19 def path(self, p): | 17 def path(self, p): |
20 p = p.lstrip('/\\') | 18 p = p.lstrip('/\\') |
21 return os.path.join(self._root, p) | 19 return os.path.join(self._root, p) |
22 | 20 |