Add reply tests
This commit is contained in:
parent
b718bbe15c
commit
17c187ea15
|
@ -8,7 +8,8 @@ class Tweet(object):
|
||||||
self.username = namerow + '.username'
|
self.username = namerow + '.username'
|
||||||
self.date = namerow + '.tweet-date'
|
self.date = namerow + '.tweet-date'
|
||||||
self.text = tweet + '.status-content.media-body'
|
self.text = tweet + '.status-content.media-body'
|
||||||
self.retweet = tweet = '.retweet'
|
self.retweet = tweet + '.retweet'
|
||||||
|
self.reply = tweet + '.replying-to'
|
||||||
|
|
||||||
|
|
||||||
class Profile(object):
|
class Profile(object):
|
||||||
|
|
|
@ -80,6 +80,11 @@ retweet = [
|
||||||
[3, 'mobile_test_8', 'mobile test 8', 'jack 🌍🌏🌎✔', '@jack', 'twttr']
|
[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):
|
class TweetTest(BaseTestCase):
|
||||||
@parameterized.expand(timeline)
|
@parameterized.expand(timeline)
|
||||||
|
@ -138,3 +143,10 @@ class TweetTest(BaseTestCase):
|
||||||
def test_invalid_id(self, tweet):
|
def test_invalid_id(self, tweet):
|
||||||
self.open_nitter(tweet)
|
self.open_nitter(tweet)
|
||||||
self.assert_text('Tweet not found', '.error-panel')
|
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)
|
||||||
|
|
Loading…
Reference in New Issue