Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zedeus committed Dec 26, 2021
1 parent 92ace2b commit b29b23f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
9 changes: 2 additions & 7 deletions tests/test_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
card = [
['Thom_Wolf/status/1122466524860702729',
'pytorch/fairseq',
'Facebook AI Research Sequence-to-Sequence Toolkit written in Python. - pytorch/fairseq',
'Facebook AI Research Sequence-to-Sequence Toolkit written in Python. - GitHub - pytorch/fairseq: Facebook AI Research Sequence-to-Sequence Toolkit written in Python.',
'github.com', True],

['nim_lang/status/1136652293510717440',
Expand Down Expand Up @@ -48,12 +48,7 @@
['nim_lang/status/1082989146040340480',
'Nim in 2018: A short recap',
'Posted in r/programming by u/miran1',
'reddit.com'],

['lorenlugosch/status/1115440394148487168',
'Fluent Speech Commands: A dataset for spoken language understanding research',
'In recent years, with the advent of deep neural networks, the accuracy of speech recognition models have been notably improved which have made possible the production of speech-to-text systems that...',
'fluent.ai']
'reddit.com']
]

playable = [
Expand Down
4 changes: 2 additions & 2 deletions tests/test_tweet.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]

status = [
[20, 'jack', 'jack', '21 Mar 2006', 'just setting up my twttr'],
[20, 'jack⚡️', 'jack', '21 Mar 2006', 'just setting up my twttr'],
[134849778302464000, 'The Twoffice', 'TheTwoffice', '11 Nov 2011', 'test'],
[105685475985080322, 'The Twoffice', 'TheTwoffice', '22 Aug 2011', 'regular tweet'],
[572593440719912960, 'Test account', 'mobile_test', '3 Mar 2015', 'testing test']
Expand Down Expand Up @@ -71,7 +71,7 @@

retweet = [
[7, 'mobile_test_2', 'mobile test 2', 'Test account', '@mobile_test', '1234'],
[3, 'mobile_test_8', 'mobile test 8', 'jack', '@jack', 'twttr']
[3, 'mobile_test_8', 'mobile test 8', 'jack⚡️', '@jack', 'twttr']
]

reply = [
Expand Down
7 changes: 4 additions & 3 deletions tests/test_tweet_media.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from base import BaseTestCase, Poll, Media
from parameterized import parameterized
from selenium.webdriver.common.by import By

poll = [
['nim_lang/status/1064219801499955200', 'Style insensitivity', '91', 1, [
Expand Down Expand Up @@ -53,8 +54,8 @@ def test_poll(self, tweet, text, votes, leader, choices):
poll_choices = self.find_elements(Poll.choice)
for i, (v, o) in enumerate(choices):
choice = poll_choices[i]
value = choice.find_element_by_class_name(Poll.value)
option = choice.find_element_by_class_name(Poll.option)
value = choice.find_element(By.CLASS_NAME, Poll.value)
option = choice.find_element(By.CLASS_NAME, Poll.option)
choice_class = choice.get_attribute('class')

self.assert_equal(v, value.text)
Expand Down Expand Up @@ -106,7 +107,7 @@ def test_gallery(self, tweet, rows):
self.assert_equal(len(rows), len(gallery_rows))

for i, row in enumerate(gallery_rows):
images = row.find_elements_by_css_selector('img')
images = row.find_elements(By.CSS_SELECTOR, 'img')
self.assert_equal(len(rows[i]), len(images))
for j, image in enumerate(images):
self.assertIn(rows[i][j], image.get_attribute('src'))

0 comments on commit b29b23f

Please sign in to comment.