From f74b2282be6c22184a258c5cd402042501435ca6 Mon Sep 17 00:00:00 2001 From: Zed Date: Sat, 15 Aug 2026 00:35:48 +0700 Subject: [PATCH] Set CI hostname to localhost for oEmbed tests --- .github/workflows/run-tests.yml | 1 + tests/test_embed.py | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index daccac9..8e6c814 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -137,6 +137,7 @@ jobs: cp nitter.example.conf nitter.conf sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf sed -i 's/maxRetries = 1/maxRetries = 10/g' nitter.conf + sed -i 's/hostname = "nitter.net"/hostname = "localhost:8080"/g' nitter.conf nim r tools/rendermd.nim nim r tools/gencss.nim diff --git a/tests/test_embed.py b/tests/test_embed.py index e44473a..a1ef3e7 100644 --- a/tests/test_embed.py +++ b/tests/test_embed.py @@ -245,15 +245,11 @@ class OEmbedDiscoveryTest(BaseTestCase): def test_oembed_discovery_roundtrip(self): """Fetch a tweet page, extract oEmbed URL, call it, verify response.""" import re - from urllib.parse import urlparse resp = requests.get(f'{self.base_url}/elonmusk/status/1141367104702038016') match = re.search( r'type="application/json\+oembed"\s+href="([^"]*)"', resp.text) self.assertIsNotNone(match, "No oEmbed discovery link found in page") oembed_url = match.group(1).replace('&', '&') - # Rewrite host to base_url in case cfg.hostname differs (e.g. CI) - parsed = urlparse(oembed_url) - oembed_url = f'{self.base_url}{parsed.path}?{parsed.query}' oembed_resp = requests.get(oembed_url) self.assertEqual(oembed_resp.status_code, 200) data = oembed_resp.json()