We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6055acb commit b8e5a6bCopy full SHA for b8e5a6b
1 file changed
tests/test_html_converter.py
@@ -19,7 +19,7 @@
19
'attrs': {'href': 'https://telegra.ph/'},
20
'children': ['Test link</a>']
21
}]
22
- },
+ },
23
{'tag': 'figure', 'children': [
24
{'tag': 'img', 'attrs': {'src': '/file/6c2ecfdfd6881d37913fa.png'}},
25
{'tag': 'figcaption'}
@@ -45,6 +45,8 @@
45
]},
46
]
47
48
+HTML_NO_STARTTAG = "</a><h1></h1>"
49
+
50
51
class TestHTMLConverter(TestCase):
52
def test_html_to_nodes(self):
@@ -130,3 +132,7 @@ def test_clear_whitespace_nodes(self):
130
132
131
133
134
self.assertEqual(clear_whitespace_nodes(nodes)[0], expected)
135
136
+ def test_no_starttag_node(self):
137
+ with self.assertRaises(InvalidHTML):
138
+ html_to_nodes(HTML_NO_STARTTAG)
0 commit comments