From a191db233c6cd6671cb04b7a564eb037d3a462c9 Mon Sep 17 00:00:00 2001 From: Andrew Paseltiner Date: Sat, 22 Jun 2024 09:16:35 -0400 Subject: [PATCH] Add basic test for inner_text --- tests/test_internals.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_internals.py b/tests/test_internals.py index 6b3cd17a..b768aede 100644 --- a/tests/test_internals.py +++ b/tests/test_internals.py @@ -34,3 +34,14 @@ def test_add_landmark_with_title(): add_landmark(dom, "file", landmarks) assert landmarks[0].title == "Bar" + +def test_inner_text(): + """ + Verify that inner_text strips leading and trailing whitespace from the root + element, retains interior whitespace, excludes all tags and attributes, and + returns both named and numeric entities as their corresponding characters. + """ + dom = se.easy_xml.EasyXmlTree('\n

a <b \tΑ c
\nd

e') + p = dom.xpath("//p")[0] + + assert p.inner_text() == "a