Update tests

This commit is contained in:
Zed
2020-06-01 02:25:56 +02:00
parent 81d6d1ac7f
commit 12c8b2659c
6 changed files with 27 additions and 52 deletions

View File

@@ -3,18 +3,14 @@ from parameterized import parameterized
normal = [['mobile_test'], ['mobile_test_2']]
after = [['mobile_test', '627635134573862912'],
['mobile_test_2', '377196342281388032']]
after = [['mobile_test', 'HBaAgJPsqtGNhA0AAA%3D%3D'],
['mobile_test_2', 'HBaAgJPsqtGNhA0AAA%3D%3D']]
short = [['mobile_test_8'], ['picman']]
no_more = [['mobile_test_8?cursor=HBaAwJCsk%2F6%2FtgQAAA%3D%3D']]
no_more = [['mobile_test_8?max_position=159455542543257601']]
empty = [['emptyuser'], ['mobile_test_10']]
none_found = [['mobile_test_8?max_position=159455542543257600']]
empty = [['maybethis'], ['mobile_test_10']]
protected = [['mobile_test_7'], ['Poop']]
protected = [['mobile_test_7'], ['Empty_user']]
class TweetTest(BaseTestCase):
@@ -27,20 +23,13 @@ class TweetTest(BaseTestCase):
self.assert_element_absent(Timeline.none)
@parameterized.expand(after)
def test_after(self, username, index):
self.open_nitter(f'{username}?max_position={index}')
def test_after(self, username, cursor):
self.open_nitter(f'{username}?cursor={cursor}')
self.assert_element_present(Timeline.newest)
self.assert_element_present(Timeline.older)
self.assert_element_absent(Timeline.end)
self.assert_element_absent(Timeline.none)
@parameterized.expand(short)
def test_short(self, username):
self.open_nitter(username)
self.assert_text('No more items', Timeline.end)
self.assert_element_absent(Timeline.newest)
self.assert_element_absent(Timeline.older)
@parameterized.expand(no_more)
def test_no_more(self, username):
self.open_nitter(username)
@@ -48,14 +37,6 @@ class TweetTest(BaseTestCase):
self.assert_element_present(Timeline.newest)
self.assert_element_absent(Timeline.older)
@parameterized.expand(none_found)
def test_none_found(self, username):
self.open_nitter(username)
self.assert_text('No items found', Timeline.none)
self.assert_element_present(Timeline.newest)
self.assert_element_absent(Timeline.older)
self.assert_element_absent(Timeline.end)
@parameterized.expand(empty)
def test_empty(self, username):
self.open_nitter(username)