mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 14:49:32 +00:00
Skip TweetResultByRestId tests on CI (CF block)
This commit is contained in:
parent
d8c1c98329
commit
a68b57629a
3 changed files with 14 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
from base import BaseTestCase, Card, Conversation
|
from base import BaseTestCase, Card, Conversation
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
||||||
|
|
@ -46,6 +48,8 @@ playable = [
|
||||||
class CardTest(BaseTestCase):
|
class CardTest(BaseTestCase):
|
||||||
@parameterized.expand(card)
|
@parameterized.expand(card)
|
||||||
def test_card(self, tweet, title, description, destination, large):
|
def test_card(self, tweet, title, description, destination, large):
|
||||||
|
if os.environ.get('GITHUB_ACTIONS') == 'true' and '2061872347477418301' in tweet:
|
||||||
|
self.skipTest('Card image unreliable from GitHub datacenter IPs')
|
||||||
self.open_nitter(tweet)
|
self.open_nitter(tweet)
|
||||||
c = Card(Conversation.main + " ")
|
c = Card(Conversation.main + " ")
|
||||||
self.assert_text(title, c.title)
|
self.assert_text(title, c.title)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
import requests
|
import requests
|
||||||
from base import BaseTestCase, Media
|
from base import BaseTestCase, Media
|
||||||
from parameterized import parameterized
|
from parameterized import parameterized
|
||||||
|
|
@ -66,6 +68,8 @@ class TweetEmbedMediaTest(BaseTestCase):
|
||||||
self.scroll_to(Media.container)
|
self.scroll_to(Media.container)
|
||||||
self.assert_element_visible(Media.gif)
|
self.assert_element_visible(Media.gif)
|
||||||
|
|
||||||
|
@unittest.skipIf(os.environ.get('GITHUB_ACTIONS') == 'true',
|
||||||
|
'TweetResultByRestId is Cloudflare-blocked from GitHub datacenter IPs')
|
||||||
def test_embed_with_video(self):
|
def test_embed_with_video(self):
|
||||||
self.open_nitter('d0m96/status/1078373829917974528/embed')
|
self.open_nitter('d0m96/status/1078373829917974528/embed')
|
||||||
self.assert_element_visible(Embed.container)
|
self.assert_element_visible(Embed.container)
|
||||||
|
|
@ -257,6 +261,8 @@ class OEmbedDiscoveryTest(BaseTestCase):
|
||||||
self.assertIn('html', data)
|
self.assertIn('html', data)
|
||||||
|
|
||||||
|
|
||||||
|
@unittest.skipIf(os.environ.get('GITHUB_ACTIONS') == 'true',
|
||||||
|
'TweetResultByRestId is Cloudflare-blocked from GitHub datacenter IPs')
|
||||||
class VideoEmbedTest(BaseTestCase):
|
class VideoEmbedTest(BaseTestCase):
|
||||||
"""Test video embed route (/i/videos/tweet/{id})."""
|
"""Test video embed route (/i/videos/tweet/{id})."""
|
||||||
video_tweet_id = '1078373829917974528'
|
video_tweet_id = '1078373829917974528'
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import os
|
||||||
|
import unittest
|
||||||
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
|
from selenium.webdriver.common.by import By
|
||||||
|
|
@ -89,6 +91,8 @@ class MediaTest(BaseTestCase):
|
||||||
|
|
||||||
@parameterized.expand(video_m3u8)
|
@parameterized.expand(video_m3u8)
|
||||||
def test_video_m3u8(self, tweet, thumb):
|
def test_video_m3u8(self, tweet, thumb):
|
||||||
|
if os.environ.get('GITHUB_ACTIONS') == 'true' and '1078373829917974528' in tweet:
|
||||||
|
self.skipTest('TweetResultByRestId is Cloudflare-blocked from GitHub datacenter IPs')
|
||||||
self.open_nitter(tweet)
|
self.open_nitter(tweet)
|
||||||
self.driver.delete_cookie("hlsPlayback")
|
self.driver.delete_cookie("hlsPlayback")
|
||||||
self.refresh()
|
self.refresh()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue