@@ -249,6 +249,12 @@ def _get_headers(self):
249
249
250
250
headers = property (_get_headers )
251
251
252
+ def __eq__ (self , other ):
253
+ if not isinstance (other , self .__class__ ):
254
+ return False
255
+
256
+ return self .body == other .body
257
+
252
258
253
259
class Request (Message ):
254
260
"""
@@ -257,8 +263,8 @@ class Request(Message):
257
263
@ivar target: The C{string} target of the request.
258
264
"""
259
265
260
- def __init__ (self , target , body = [] , envelope = None ):
261
- Message .__init__ (self , envelope , body )
266
+ def __init__ (self , target , body = None , envelope = None ):
267
+ Message .__init__ (self , envelope , body or [] )
262
268
263
269
self .target = target
264
270
@@ -270,6 +276,12 @@ def __repr__(self):
270
276
type (self ).__name__
271
277
)
272
278
279
+ def __eq__ (self , other ):
280
+ if not super (Request , self ).__eq__ (other ):
281
+ return False
282
+
283
+ return self .target == other .target
284
+
273
285
274
286
class Response (Message ):
275
287
"""
@@ -290,6 +302,12 @@ def __repr__(self):
290
302
type (self ).__name__
291
303
)
292
304
305
+ def __eq__ (self , other ):
306
+ if not super (Response , self ).__eq__ (other ):
307
+ return False
308
+
309
+ return self .status == other .status
310
+
293
311
294
312
class BaseFault (object ):
295
313
"""
0 commit comments