summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKarl Lorey <git@karllorey.com>2022-06-24 01:06:37 +0200
committerKarl Lorey <git@karllorey.com>2022-06-24 01:06:37 +0200
commitd567ea3ecf5f1bf7e42e4d93def6052b7adc5fa2 (patch)
tree22b98378578c1589b07ba725c873fe59c39e455f /tests
parentc54208e15c2b303cced2698ff331962d243b6329 (diff)
Also match all parents that contain the same text
Diffstat (limited to 'tests')
-rw-r--r--tests/test_html.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/test_html.py b/tests/test_html.py
index 7780504..ab7a6b3 100644
--- a/tests/test_html.py
+++ b/tests/test_html.py
@@ -102,8 +102,10 @@ def test_find_text_with_whitespace():
html = b"<html><body><p> whitespace \n\t </p></body></html>"
page = Page(html)
html_matches = page.find_all("whitespace")
- assert len(html_matches) == 1
- assert isinstance(html_matches[0], HTMLExactTextMatch)
+
+ # should match p, body, html (and document)
+ assert len(html_matches) == 4
+ assert all(isinstance(hm, HTMLExactTextMatch) for hm in html_matches)
def test_find_text_with_noise():