From 17c187ea151a7f648b7fd3caf67a495aa06a7b50 Mon Sep 17 00:00:00 2001 From: Zed Date: Mon, 12 Aug 2019 16:55:04 +0200 Subject: [PATCH] Add reply tests --- tests/base.py | 3 ++- tests/test_tweet.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/base.py b/tests/base.py index b40cabd..d909aa5 100644 --- a/tests/base.py +++ b/tests/base.py @@ -8,7 +8,8 @@ class Tweet(object): self.username = namerow + '.username' self.date = namerow + '.tweet-date' self.text = tweet + '.status-content.media-body' - self.retweet = tweet = '.retweet' + self.retweet = tweet + '.retweet' + self.reply = tweet + '.replying-to' class Profile(object): diff --git a/tests/test_tweet.py b/tests/test_tweet.py index c62f1c8..fc3eedd 100644 --- a/tests/test_tweet.py +++ b/tests/test_tweet.py @@ -80,6 +80,11 @@ retweet = [ [3, 'mobile_test_8', 'mobile test 8', 'jack 🌍🌏🌎✔', '@jack', 'twttr'] ] +reply = [ + ['mobile_test?after=471336696307392513', '@mobile_test', '@mobile_test'], + ['mobile_test_2?after=375101899214561280', '@mobile_test_2', '@mobile_test'] +] + class TweetTest(BaseTestCase): @parameterized.expand(timeline) @@ -138,3 +143,10 @@ class TweetTest(BaseTestCase): def test_invalid_id(self, tweet): self.open_nitter(tweet) self.assert_text('Tweet not found', '.error-panel') + + @parameterized.expand(reply) + def test_reply(self, tweet, username, reply): + self.open_nitter(tweet) + tweet = get_timeline_tweet(1) + self.assert_text(username, tweet.username) + self.assert_text('Replying to ' + reply, tweet.reply)