comparison tests/mockutil.py @ 328:2a5996e0d3ec

tests: Raise an exception instead of crashing rudely.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 31 Mar 2015 22:38:56 -0700
parents 7544c03b6bab
children 8511137d1b62
comparison
equal deleted inserted replaced
327:b30ab97e091b 328:2a5996e0d3ec
161 161
162 def getStructure(self, path=None): 162 def getStructure(self, path=None):
163 root = self._fs[self._root] 163 root = self._fs[self._root]
164 if path: 164 if path:
165 root = self._getEntry(self.path(path)) 165 root = self._getEntry(self.path(path))
166 if root is None:
167 raise Exception("No such path: %s" % path)
166 168
167 res = {} 169 res = {}
168 for k, v in root.items(): 170 for k, v in root.items():
169 self._getStructureRecursive(v, res, k) 171 self._getStructureRecursive(v, res, k)
170 return res 172 return res