summaryrefslogtreecommitdiff
path: root/python/subunit/content.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2009-10-24 19:24:09 +1100
committerRobert Collins <robertc@robertcollins.net>2009-10-24 19:24:09 +1100
commitab0aada6011a4d0db688de56cffef931d5585629 (patch)
tree44a15a4b47f92a139bc9b9ea6bbced81149e7320 /python/subunit/content.py
parent1397750c1112952370adbd70f5e19745de8691be (diff)
downloadsubunit-git-ab0aada6011a4d0db688de56cffef931d5585629.tar.gz
change error reports to use the extended details interface.
Diffstat (limited to 'python/subunit/content.py')
-rw-r--r--python/subunit/content.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/subunit/content.py b/python/subunit/content.py
index 160a58a..d7d3893 100644
--- a/python/subunit/content.py
+++ b/python/subunit/content.py
@@ -42,6 +42,10 @@ class Content(object):
self.content_type = content_type
self._get_bytes = get_bytes
+ def __eq__(self, other):
+ return (self.content_type == other.content_type and
+ ''.join(self.iter_bytes()) == ''.join(other.iter_bytes()))
+
def iter_bytes(self):
"""Iterate over bytestrings of the serialised content."""
return self._get_bytes()