mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 06:17:25 +00:00
test(web-app-openpost): keep the malformed-host test URLs out of the URL probe
test_urls_reachable.py probes every literal URL and fails hard on one it cannot parse, and http://a..b/m.jpg in the malformed-media-host tests of test_service.py and test_web.py is unparsable on purpose (PR 2951 run 45676116645, LocationParseError). Both lines carry the repository's per-line nocheck url marker. 🎯 Fix: 97 % 💥 Break: 1 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 96 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e6ac985bb
commit
b7fd505da4
2 files changed
+2
-2
No files matched your search
@@ -474,7 +474,7 @@ class TestDelivery(ServiceFixture, unittest.TestCase):
|
||||
self.assertEqual({row["state"] for row in database.items}, {"drafted"})
|
||||
|
||||
def test_a_malformed_media_host_fails_the_delivery_not_the_service(self) -> None:
|
||||
for url in ("http://%00/m.jpg", "http://a..b/m.jpg"):
|
||||
for url in ("http://%00/m.jpg", "http://a..b/m.jpg"): # nocheck: url
|
||||
with self.subTest(url=url):
|
||||
runner, database, _ = self.build("review", [picture(101, url)])
|
||||
database.cursors["press"] = "100"
|
||||
|
||||
@@ -178,7 +178,7 @@ class TestRefusedUrls(unittest.TestCase):
|
||||
|
||||
def test_a_malformed_host_is_a_request_error(self) -> None:
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
for url in ("http://%00/m.jpg", "http://a..b/m.jpg"):
|
||||
for url in ("http://%00/m.jpg", "http://a..b/m.jpg"): # nocheck: url
|
||||
with self.subTest(url=url), self.assertRaises(web.RequestError):
|
||||
web.download(url, {}, Path(folder) / "m.jpg")
|
||||
|
||||
|
||||
Reference in new issue
Block a user