Skip to content

Commit fcecde0

Browse files
committed
updates tests for changes to repr functions
1 parent 724fafb commit fcecde0

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/test_models.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def test_category(self):
4040
def test_direct_message(self):
4141
""" Test twitter.DirectMessage object """
4242
dm = twitter.DirectMessage.NewFromJsonDict(self.DIRECT_MESSAGE_SAMPLE_JSON)
43-
self.assertEqual(dm.__repr__(), "DirectMessage(ID=678629245946433539, Sender=__jcbl__, Time=Sun Dec 20 17:33:15 +0000 2015, Text='The Communists are distinguished from the other working-class parties by this only: 1. In the national struggles of the proletarians of the [...]')")
43+
self.assertEqual(dm.__repr__(), "DirectMessage(ID=678629245946433539, Sender=__jcbl__, Created=Sun Dec 20 17:33:15 +0000 2015, Text='The Communists are distinguished from the other working-class parties by this only: 1. In the national struggles of the proletarians of the [...]')")
4444
dm_short = twitter.DirectMessage.NewFromJsonDict(self.DIRECT_MESSAGE_SHORT_SAMPLE_JSON)
45-
self.assertEqual(dm_short.__repr__(), "DirectMessage(ID=678629245946433539, Sender=__jcbl__, Time=Sun Dec 20 17:33:15 +0000 2015, Text='The Communists are distinguished from the other working-class parties by this only')")
45+
self.assertEqual(dm_short.__repr__(), "DirectMessage(ID=678629245946433539, Sender=__jcbl__, Created=Sun Dec 20 17:33:15 +0000 2015, Text='The Communists are distinguished from the other working-class parties by this only')")
4646
self.assertTrue(dm.AsJsonString())
4747
self.assertTrue(dm.AsDict())
4848

@@ -70,7 +70,7 @@ def test_media(self):
7070
def test_status(self):
7171
""" Test twitter.Status object """
7272
status = twitter.Status.NewFromJsonDict(self.STATUS_SAMPLE_JSON)
73-
self.assertEqual(status.__repr__(), "Status(ID=698657677329752065, screen_name='himawari8bot', created_at='Sat Feb 13 23:59:05 +0000 2016')")
73+
self.assertEqual(status.__repr__(), "Status(ID=698657677329752065, ScreenName='himawari8bot', Created='Sat Feb 13 23:59:05 +0000 2016')")
7474
self.assertTrue(status.AsJsonString())
7575
self.assertTrue(status.AsDict())
7676
self.assertTrue(status.media[0].AsJsonString())
@@ -80,7 +80,7 @@ def test_status(self):
8080
def test_status_no_user(self):
8181
""" Test twitter.Status object which does not contain a 'user' entity. """
8282
status = twitter.Status.NewFromJsonDict(self.STATUS_NO_USER_SAMPLE_JSON)
83-
self.assertEqual(status.__repr__(), "Status(ID=698657677329752065, created_at='Sat Feb 13 23:59:05 +0000 2016')")
83+
self.assertEqual(status.__repr__(), "Status(ID=698657677329752065, Created='Sat Feb 13 23:59:05 +0000 2016')")
8484
self.assertTrue(status.AsJsonString())
8585
self.assertTrue(status.AsDict())
8686

@@ -101,7 +101,7 @@ def test_user(self):
101101
'''Test the twitter.User NewFromJsonDict method'''
102102
user = twitter.User.NewFromJsonDict(self.USER_SAMPLE_JSON)
103103
self.assertEqual(user.id, 718443)
104-
self.assertEqual(user.__repr__(), "User(ID=718443, Screenname=kesuke)")
104+
self.assertEqual(user.__repr__(), "User(ID=718443, ScreenName=kesuke)")
105105
self.assertTrue(user.AsJsonString())
106106
self.assertTrue(user.AsDict())
107107

@@ -110,7 +110,7 @@ def test_user_status(self):
110110
user_status = twitter.UserStatus.NewFromJsonDict(self.USER_STATUS_SAMPLE_JSON)
111111
# __repr__ doesn't always order 'connections' in the same manner when
112112
# call, hence the regex.
113-
mtch = re.compile(r'UserStatus\(ID=6385432, Name=dickc, Connections=\[[blocking|muting]+, [blocking|muting]+\]\)')
113+
mtch = re.compile(r'UserStatus\(ID=6385432, ScreenName=dickc, Connections=\[[blocking|muting]+, [blocking|muting]+\]\)')
114114
self.assertTrue(re.findall(mtch, user_status.__repr__()))
115115
self.assertTrue(user_status.AsJsonString())
116116
self.assertTrue(user_status.AsDict())

tests/test_status.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@ def testNewFromJsonDict(self):
120120

121121
def testStatusRepresentation(self):
122122
status = self._GetSampleStatus()
123-
self.assertEqual("Status(ID=4391023, screen_name='kesuke', created_at='Fri Jan 26 23:17:14 +0000 2007')", status.__repr__())
123+
self.assertEqual("Status(ID=4391023, ScreenName='kesuke', Created='Fri Jan 26 23:17:14 +0000 2007')", status.__repr__())

0 commit comments

Comments
 (0)