comparison tests/tmpfs.py @ 974:72f17534d58e

tests: First pass on making unit tests work again. - Fix all imports - Add more helper functions to work with mock file-systems - Simplify some code by running chef directly on the mock FS - Fix a couple tests
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 17 Oct 2017 01:07:30 -0700
parents f987b29d6fab
children 45ad976712ec
comparison
equal deleted inserted replaced
973:8419daaa7a0e 974:72f17534d58e
7 7
8 8
9 class TempDirFileSystem(TestFileSystemBase): 9 class TempDirFileSystem(TestFileSystemBase):
10 def __init__(self): 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 16
17 def path(self, p): 17 def path(self, p):
18 p = p.lstrip('/\\') 18 p = p.lstrip('/\\')
19 return os.path.join(self._root, p) 19 return os.path.join(self._root, p)