Skip to content

Commit 0ce85c6

Browse files
committed
fix(tests/integration): add more robust text assertion on the StrictDoc test
1 parent c2488ea commit 0ce85c6

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

  • tests/integration/40_sdoc_only_child_does_not_break_page_when_surrounded_by_text_nodes

tests/integration/40_sdoc_only_child_does_not_break_page_when_surrounded_by_text_nodes/test.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,30 @@
1313
# NOTE: The replace() calls are needed because of the portability issues.
1414
#
1515

16+
page2_text_normalized = (
17+
reader.pages[2].extract_text().replace("leo.StrictDoc", "leo.\nStrictDoc")
18+
)
1619
assert (
17-
reader.pages[2].extract_text()
20+
page2_text_normalized
1821
== """\
1922
1. Section 1
2023
Vivamus consectetur mollis varius. Quisque posuere venenatis nulla, sit amet
2124
pulvinar metus vestibulum sed. Sed at libero nec justo leo.
2225
StrictDoc Documentation Test document
23-
3/4
24-
2025-12-21\
26+
2025-12-21 3/4\
2527
"""
26-
), reader.pages[2].extract_text().replace(".StrictDoc", "\nStrictDoc")
28+
), page2_text_normalized
29+
30+
page3_text_normalized = (
31+
reader.pages[3].extract_text().replace("cStrictDoc", "c\nStrictDoc")
32+
)
2733

2834
assert (
29-
reader.pages[3].extract_text()
35+
page3_text_normalized
3036
== """\
3137
2. Section 2
3238
Lorem ipsum dolor sit amet, c
3339
StrictDoc Documentation Test document
34-
4/4
35-
2025-12-21\
40+
2025-12-21 4/4\
3641
"""
37-
), reader.pages[3].extract_text().replace("cStrictDoc", "c\nStrictDoc")
42+
), page3_text_normalized

0 commit comments

Comments
 (0)