Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit b34a585

Browse files
committed
Get 100% coverage on nodes.py
1 parent 5d03d91 commit b34a585

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

html_tstring/nodes_test.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ def test_void_element_no_children():
7474
assert str(br) == "<br />"
7575

7676

77+
def test_element_invalid_empty_tag():
78+
with pytest.raises(ValueError):
79+
_ = Element("")
80+
81+
82+
def test_element_is_content():
83+
assert Element("script").is_content
84+
assert Element("title").is_content
85+
assert not Element("div").is_content
86+
assert not Element("br").is_content # Void element
87+
88+
7789
def test_void_element_with_attributes():
7890
br = Element("br", attrs={"class": "line-break", "hidden": None})
7991
assert str(br) == '<br class="line-break" hidden />'

0 commit comments

Comments
 (0)