mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2026-09-23 19:03:18 +00:00
test: parse the page instead of matching tags with a regex
The inline-script check matched <script\b[^>]*> and then filtered the matched text, so a > inside an attribute value split one tag into a fragment that had already lost the attribute the filter looks for. An html.parser subclass decides on the parsed attributes instead. The i18n test imported unittest twice, once plain and once as a from-import. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,8 +2,8 @@ import re
|
||||
import shutil
|
||||
import tempfile
|
||||
import unittest
|
||||
import unittest.mock
|
||||
from pathlib import Path
|
||||
from unittest import mock
|
||||
|
||||
import yaml
|
||||
|
||||
@@ -170,7 +170,7 @@ class TestCatalogMerge(unittest.TestCase):
|
||||
)
|
||||
|
||||
def test_an_unsupported_code_never_becomes_a_path(self):
|
||||
with mock.patch.object(i18n, "read_catalog") as read:
|
||||
with unittest.mock.patch.object(i18n, "read_catalog") as read:
|
||||
self.assertEqual(i18n.catalog("../content/de"), {})
|
||||
|
||||
read.assert_not_called()
|
||||
|
||||
Reference in New Issue
Block a user