Update tests

This commit is contained in:
Zed 2021-12-26 02:23:05 +01:00
parent 92ace2bf70
commit b29b23fea2
3 changed files with 8 additions and 12 deletions

View File

@ -5,7 +5,7 @@ from parameterized import parameterized
card = [ card = [
['Thom_Wolf/status/1122466524860702729', ['Thom_Wolf/status/1122466524860702729',
'pytorch/fairseq', '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], 'github.com', True],
['nim_lang/status/1136652293510717440', ['nim_lang/status/1136652293510717440',
@ -48,12 +48,7 @@ no_thumb = [
['nim_lang/status/1082989146040340480', ['nim_lang/status/1082989146040340480',
'Nim in 2018: A short recap', 'Nim in 2018: A short recap',
'Posted in r/programming by u/miran1', 'Posted in r/programming by u/miran1',
'reddit.com'], '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']
] ]
playable = [ playable = [

View File

@ -16,7 +16,7 @@ timeline = [
] ]
status = [ 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'], [134849778302464000, 'The Twoffice', 'TheTwoffice', '11 Nov 2011', 'test'],
[105685475985080322, 'The Twoffice', 'TheTwoffice', '22 Aug 2011', 'regular tweet'], [105685475985080322, 'The Twoffice', 'TheTwoffice', '22 Aug 2011', 'regular tweet'],
[572593440719912960, 'Test account', 'mobile_test', '3 Mar 2015', 'testing test'] [572593440719912960, 'Test account', 'mobile_test', '3 Mar 2015', 'testing test']
@ -71,7 +71,7 @@ emoji = [
retweet = [ retweet = [
[7, 'mobile_test_2', 'mobile test 2', 'Test account', '@mobile_test', '1234'], [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 = [ reply = [

View File

@ -1,5 +1,6 @@
from base import BaseTestCase, Poll, Media from base import BaseTestCase, Poll, Media
from parameterized import parameterized from parameterized import parameterized
from selenium.webdriver.common.by import By
poll = [ poll = [
['nim_lang/status/1064219801499955200', 'Style insensitivity', '91', 1, [ ['nim_lang/status/1064219801499955200', 'Style insensitivity', '91', 1, [
@ -53,8 +54,8 @@ class MediaTest(BaseTestCase):
poll_choices = self.find_elements(Poll.choice) poll_choices = self.find_elements(Poll.choice)
for i, (v, o) in enumerate(choices): for i, (v, o) in enumerate(choices):
choice = poll_choices[i] choice = poll_choices[i]
value = choice.find_element_by_class_name(Poll.value) value = choice.find_element(By.CLASS_NAME, Poll.value)
option = choice.find_element_by_class_name(Poll.option) option = choice.find_element(By.CLASS_NAME, Poll.option)
choice_class = choice.get_attribute('class') choice_class = choice.get_attribute('class')
self.assert_equal(v, value.text) self.assert_equal(v, value.text)
@ -106,7 +107,7 @@ class MediaTest(BaseTestCase):
self.assert_equal(len(rows), len(gallery_rows)) self.assert_equal(len(rows), len(gallery_rows))
for i, row in enumerate(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)) self.assert_equal(len(rows[i]), len(images))
for j, image in enumerate(images): for j, image in enumerate(images):
self.assertIn(rows[i][j], image.get_attribute('src')) self.assertIn(rows[i][j], image.get_attribute('src'))