Skip to content

Commit

Permalink
Attempt to pass tests
Browse files Browse the repository at this point in the history
The githup_106 test is a bit odd, because I'm not sure what changed.

Whitespace should be identical though, even without the lstrip.
Which is easy enough to check.
  • Loading branch information
Shiandow committed Oct 9, 2024
1 parent d46894f commit d63e6b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ def __run_single_node_test(self, text, text_only=False, number_of_sentences=None
self.assertEqual(len(node.getchildren()), number_of_sentences)

for span in node.getchildren():
# spans should not end in whitespace (PR#191)
self.assertFalse(re.match(r'\s', span.tail[-1]))
# spans should not end in whitespace (PR#191), and be nonempty
self.assertFalse(re.match(r'\s', span.text[-1]))
# tail of span should *only* be whitespace
self.assertTrue(re.match(r'\s*', span.tail[-1] or ''))
self.assertTrue(re.match(r'\s*', span.tail or ''))

# attrib is technically of type lxml.etree._Attrib, but functionally
# it's a dict. Cast it here to make assertDictEqual() happy.
Expand Down Expand Up @@ -360,7 +360,7 @@ def test_gitub_pr_106(self):

pre_span = self.container.parsed(container_name)
text_chunks = [
g.lstrip("\n\t")
g
for g in pre_span.xpath(
"//xhtml:p//text()", namespaces={"xhtml": container.XHTML_NAMESPACE}
)
Expand All @@ -370,7 +370,7 @@ def test_gitub_pr_106(self):

post_span = self.container.parsed(container_name)
post_text_chunks = [
g.lstrip("\n\t")
g
for g in post_span.xpath(
"//xhtml:p//text()", namespaces={"xhtml": container.XHTML_NAMESPACE}
)
Expand Down

0 comments on commit d63e6b4

Please sign in to comment.