changeset 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 b30ab97e091b
children 422052d2e978
files tests/mockutil.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/mockutil.py	Mon Mar 30 21:32:08 2015 -0700
+++ b/tests/mockutil.py	Tue Mar 31 22:38:56 2015 -0700
@@ -163,6 +163,8 @@
         root = self._fs[self._root]
         if path:
             root = self._getEntry(self.path(path))
+            if root is None:
+                raise Exception("No such path: %s" % path)
 
         res = {}
         for k, v in root.items():