summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Bicking <ian@ianbicking.org>2005-09-12 20:20:00 +0000
committerIan Bicking <ian@ianbicking.org>2005-09-12 20:20:00 +0000
commitd271dafd29d8991ae588c930f54c25354620c48c (patch)
tree0b60d4eb49c4a814a081864d1f4e3dc2c9a34368
parent2aeb229eebe056a0a5849b814f74d04b89db5836 (diff)
downloadpaste-git-d271dafd29d8991ae588c930f54c25354620c48c.tar.gz
Nicer repr() and error message
-rw-r--r--paste/fixture.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/paste/fixture.py b/paste/fixture.py
index 739d4a8..dc40bb2 100644
--- a/paste/fixture.py
+++ b/paste/fixture.py
@@ -763,8 +763,17 @@ class FoundFile(object):
return s in self.bytes
def mustcontain(self, s):
+ __tracebackhide__ = True
bytes = self.bytes
- assert s in bytes
+ if s not in bytes:
+ print 'Could not find %r in:' % s
+ print bytes
+ assert s in bytes
+
+ def __repr__(self):
+ return '<%s %s:%s>' % (
+ self.__class__.__name__,
+ self.base_path, self.path)
class FoundDir(object):
@@ -778,6 +787,11 @@ class FoundDir(object):
self.size = 'N/A'
self.mtime = 'N/A'
+ def __repr__(self):
+ return '<%s %s:%s>' % (
+ self.__class__.__name__,
+ self.base_path, self.path)
+
def _popget(d, key, default=None):
"""
Pop the key if found (else return default)