Skip to content

Commit 8e5ccbf

Browse files
committed
Add illustrative test coverage
1 parent ca88466 commit 8e5ccbf

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

tests/test_module.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ def test_extra_tag():
129129
assert Etree.tostring(root, method="html") == b'<html><body></body></html>'
130130

131131

132+
def test_find_empty_attribute():
133+
# Check whether we can find an element with an empty attribute
134+
html = "<html><body><form autofocus><input type='checkbox' checked></form></body></html>"
135+
form = quick_parse_filter(html, "form", {"autofocus": True})
136+
assert "autofocus" in form.attrib
137+
assert form.find(".//input[@checked]") is not None
138+
139+
132140
# ############################# HTML Entity ############################## #
133141

134142

0 commit comments

Comments
 (0)