Skip to content

Commit b8e5a6b

Browse files
committed
add test
1 parent 6055acb commit b8e5a6b

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/test_html_converter.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'attrs': {'href': 'https://telegra.ph/'},
2020
'children': ['Test link</a>']
2121
}]
22-
},
22+
},
2323
{'tag': 'figure', 'children': [
2424
{'tag': 'img', 'attrs': {'src': '/file/6c2ecfdfd6881d37913fa.png'}},
2525
{'tag': 'figcaption'}
@@ -45,6 +45,8 @@
4545
]},
4646
]
4747

48+
HTML_NO_STARTTAG = "</a><h1></h1>"
49+
4850

4951
class TestHTMLConverter(TestCase):
5052
def test_html_to_nodes(self):
@@ -130,3 +132,7 @@ def test_clear_whitespace_nodes(self):
130132
]
131133

132134
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

Comments
 (0)