Enable disabled tests

This commit is contained in:
Zed 2023-11-15 11:11:56 +00:00
parent c2819dab44
commit 06ab1ea2e7
1 changed files with 27 additions and 31 deletions

View File

@ -1,4 +1,4 @@
from base import BaseTestCase, Tweet, get_timeline_tweet from base import BaseTestCase, Tweet, Conversation, get_timeline_tweet
from parameterized import parameterized from parameterized import parameterized
# image = tweet + 'div.attachments.media-body > div > div > a > div > img' # image = tweet + 'div.attachments.media-body > div > div > a > div > img'
@ -83,22 +83,18 @@ retweet = [
[3, 'mobile_test_8', 'mobile test 8', 'jack', '@jack', 'twttr'] [3, 'mobile_test_8', 'mobile test 8', 'jack', '@jack', 'twttr']
] ]
# reply = [
# ['mobile_test/with_replies', 15]
# ]
class TweetTest(BaseTestCase): class TweetTest(BaseTestCase):
# @parameterized.expand(timeline) @parameterized.expand(timeline)
# def test_timeline(self, index, fullname, username, date, tid, text): def test_timeline(self, index, fullname, username, date, tid, text):
# self.open_nitter(username) self.open_nitter(username)
# tweet = get_timeline_tweet(index) tweet = get_timeline_tweet(index)
# self.assert_exact_text(fullname, tweet.fullname) self.assert_exact_text(fullname, tweet.fullname)
# self.assert_exact_text('@' + username, tweet.username) self.assert_exact_text('@' + username, tweet.username)
# self.assert_exact_text(date, tweet.date) self.assert_exact_text(date, tweet.date)
# self.assert_text(text, tweet.text) self.assert_text(text, tweet.text)
# permalink = self.find_element(tweet.date + ' a') permalink = self.find_element(tweet.date + ' a')
# self.assertIn(tid, permalink.get_attribute('href')) self.assertIn(tid, permalink.get_attribute('href'))
@parameterized.expand(status) @parameterized.expand(status)
def test_status(self, tid, fullname, username, date, text): def test_status(self, tid, fullname, username, date, text):
@ -112,18 +108,18 @@ class TweetTest(BaseTestCase):
@parameterized.expand(multiline) @parameterized.expand(multiline)
def test_multiline_formatting(self, tid, username, text): def test_multiline_formatting(self, tid, username, text):
self.open_nitter(f'{username}/status/{tid}') self.open_nitter(f'{username}/status/{tid}')
self.assert_text(text.strip('\n'), '.main-tweet') self.assert_text(text.strip('\n'), Conversation.main)
@parameterized.expand(emoji) @parameterized.expand(emoji)
def test_emoji(self, tweet, text): def test_emoji(self, tweet, text):
self.open_nitter(tweet) self.open_nitter(tweet)
self.assert_text(text, '.main-tweet') self.assert_text(text, Conversation.main)
@parameterized.expand(link) @parameterized.expand(link)
def test_link(self, tweet, links): def test_link(self, tweet, links):
self.open_nitter(tweet) self.open_nitter(tweet)
for link in links: for link in links:
self.assert_text(link, '.main-tweet') self.assert_text(link, Conversation.main)
@parameterized.expand(username) @parameterized.expand(username)
def test_username(self, tweet, usernames): def test_username(self, tweet, usernames):
@ -132,14 +128,14 @@ class TweetTest(BaseTestCase):
link = self.find_link_text(f'@{un}') link = self.find_link_text(f'@{un}')
self.assertIn(f'/{un}', link.get_property('href')) self.assertIn(f'/{un}', link.get_property('href'))
# @parameterized.expand(retweet) @parameterized.expand(retweet)
# def test_retweet(self, index, url, retweet_by, fullname, username, text): def test_retweet(self, index, url, retweet_by, fullname, username, text):
# self.open_nitter(url) self.open_nitter(url)
# tweet = get_timeline_tweet(index) tweet = get_timeline_tweet(index)
# self.assert_text(f'{retweet_by} retweeted', tweet.retweet) self.assert_text(f'{retweet_by} retweeted', tweet.retweet)
# self.assert_text(text, tweet.text) self.assert_text(text, tweet.text)
# self.assert_exact_text(fullname, tweet.fullname) self.assert_exact_text(fullname, tweet.fullname)
# self.assert_exact_text(username, tweet.username) self.assert_exact_text(username, tweet.username)
@parameterized.expand(invalid) @parameterized.expand(invalid)
def test_invalid_id(self, tweet): def test_invalid_id(self, tweet):