[Zope3-checkins] CVS: Zope3/src/zodb/tests - emailbench.py:1.2
Jeremy Hylton
jeremy@zope.com
Tue, 22 Apr 2003 11:19:56 -0400
Update of /cvs-repository/Zope3/src/zodb/tests
In directory cvs.zope.org:/tmp/cvs-serv13177
Modified Files:
emailbench.py
Log Message:
Messages get put in OOSets, so they need an __cmp__.
=== Zope3/src/zodb/tests/emailbench.py 1.1 => 1.2 ===
--- Zope3/src/zodb/tests/emailbench.py:1.1 Mon Apr 21 14:00:42 2003
+++ Zope3/src/zodb/tests/emailbench.py Tue Apr 22 11:19:55 2003
@@ -75,6 +75,17 @@
self.headers = headers
self.payload = payload
+ def __cmp__(self, msg):
+ # The headers and payload must be the same, but start with
+ # a simple check of the msgid.
+ x = cmp(self.msgid, msg.msgid)
+ if x:
+ return x
+ x = cmp(self.headers, msg.headers)
+ if x:
+ return x
+ return cmp(self.payload, msg.payload)
+
def fromEmail(cls, msg):
recipients = []
for h in "to", "cc", "bcc":