Add reply tests

This commit is contained in:
Zed 2019-08-12 16:55:04 +02:00
parent b718bbe15c
commit 17c187ea15
2 changed files with 14 additions and 1 deletions

View File

@ -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):

View File

@ -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)