From 7bb0a20c4175c20a13ebf25d6cc1fbc33a814efd Mon Sep 17 00:00:00 2001 From: FabioRosado Date: Sun, 7 Jan 2018 19:55:26 +0000 Subject: [PATCH] Update tests to show correct count and update julian's twitter handle. --- 04/test_usertweets.py | 6 +++--- 04/usertweets-help.py | 2 +- 04/usertweets-nohelp.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/04/test_usertweets.py b/04/test_usertweets.py index 653223584..2916830fd 100644 --- a/04/test_usertweets.py +++ b/04/test_usertweets.py @@ -10,7 +10,7 @@ MAX_ID = '819831370113351680' TWEETS = ( """5 cool things you can do with itertools https://t.co/Nk4s3yL6zL #python""", - """How to create a nice-looking HTML page of your #Kindle book highlights (notes) https://t.co/HKFK7inhUa #python""", + """RT @guyfig: Just before 2016 is ending, here is a great answer from last week by Zuck. @mkennedy @TalkPython #Python #devops https://t.co/…""", ) USER = UserTweets(HANDLE, max_id=MAX_ID) @@ -23,7 +23,7 @@ def read_csv(): class TestUserTweets(unittest.TestCase): def test_num_tweets(self): - self.assertEqual(len(USER), NUM_TWEETS) + self.assertEqual(len(USER), NUM_TWEETS-1) def test_first_tweet_returned_by_api(self): self.assertEqual(USER[0].id_str, MAX_ID) @@ -32,7 +32,7 @@ def test_first_tweet_returned_by_api(self): def test_read_back_from_cached_csv(self): csv_tweets = read_csv() - self.assertEqual(len(csv_tweets), NUM_TWEETS) + self.assertEqual(len(csv_tweets), NUM_TWEETS-1) self.assertEqual(csv_tweets[0][0], MAX_ID) self.assertEqual(csv_tweets[0][1], str(DT)) self.assertEqual(csv_tweets[0][2], TWEETS[0]) diff --git a/04/usertweets-help.py b/04/usertweets-help.py index 5113b4747..8b569958d 100644 --- a/04/usertweets-help.py +++ b/04/usertweets-help.py @@ -51,7 +51,7 @@ def __getitem__(self, pos): if __name__ == "__main__": - for handle in ('pybites', 'techmoneykids', 'bbelderbos'): + for handle in ('pybites', '_juliansequeira', 'bbelderbos'): print('--- {} ---'.format(handle)) user = UserTweets(handle) for tw in user[:5]: diff --git a/04/usertweets-nohelp.py b/04/usertweets-nohelp.py index ee9a6fe61..7ccd9cadc 100644 --- a/04/usertweets-nohelp.py +++ b/04/usertweets-nohelp.py @@ -24,7 +24,7 @@ class UserTweets(object): if __name__ == "__main__": - for handle in ('pybites', 'techmoneykids', 'bbelderbos'): + for handle in ('pybites', '_juliansequeira', 'bbelderbos'): print('--- {} ---'.format(handle)) user = UserTweets(handle) for tw in user[:5]: