Skip to content

Commit

Permalink
Merge pull request #18 from OCA/silence-xpath-warning
Browse files Browse the repository at this point in the history
Silence xpath warning in tests
  • Loading branch information
sbidoul authored Oct 19, 2024
2 parents 68c4c1d + f210527 commit cc4e8ff
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py3o/template/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def test_image_injection(self):

i = 0
nmspc = template.namespaces
table = content_list.find("//table:table", nmspc)
table = content_list.find(".//table:table", nmspc)
frame_path = "table:table-cell/text:p/draw:frame"
images_hrefs = set()
for row in table.findall("table:table-row", nmspc):
Expand All @@ -707,7 +707,7 @@ def test_image_injection(self):

# check if images are into the manifest
manifest_el = lxml.etree.parse(BytesIO(outodt.read(MANIFEST)))
file_entries = manifest_el.findall("//manifest:file-entry", nmspc)
file_entries = manifest_el.findall(".//manifest:file-entry", nmspc)
for entry in file_entries:
path = entry.get("{{{}}}full-path".format(nmspc["manifest"]))
if path in images_hrefs:
Expand Down Expand Up @@ -971,7 +971,7 @@ def test_remove_soft_page_breaks(self):
)

nmspc = template.namespaces
paragraphs = content_list.findall("//text:p", nmspc)
paragraphs = content_list.findall(".//text:p", nmspc)
bottom_break_paragraphs, middle_break_paragraphs = 0, 0
for p in paragraphs:
if not p.text:
Expand Down

0 comments on commit cc4e8ff

Please sign in to comment.