jackybowen / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

Add missing Trend.__eq__, Trend.__ne__, and unit tests for Trends #218

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, two Trends containing the same information (name, query, and 
timestamp) aren't considered equal because __eq__ isn't overridden, like it is 
for Status, User, and the other Twitter objects.

Currently:

>>> from twitter import Trend
>>> trend = Trend(name='foo', query='bar', timestamp='baz')
>>> trend2 = Trend(name='foo', query='bar', timestamp='baz')
>>> trend == trend2
False
>>> 

After this patch:

>>> from twitter import Trend
>>> trend = Trend(name='foo', query='bar', timestamp='baz')
>>> trend2 = Trend(name='foo', query='bar', timestamp='baz')
>>> trend == trend2
True
>>> trend3 = Trend(name='baz', query='quux')
>>> trend == trend3
False
>>> 

Original issue reported on code.google.com by jessica....@gmail.com on 27 Nov 2011 at 1:25

Attachments:

GoogleCodeExporter commented 9 years ago
committed changeset 236:39a19acd26fb

much thanks for the patch *AND* tests!

Original comment by bear42 on 3 Dec 2011 at 9:47