From a661e199c312b64dabd9a00beba9418230e3102e Mon Sep 17 00:00:00 2001 From: rue_a Date: Mon, 15 Jan 2024 14:50:09 +0100 Subject: [PATCH] rm img path attribs --- tests/test_workspace.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/test_workspace.py b/tests/test_workspace.py index c7a5991..4593ded 100644 --- a/tests/test_workspace.py +++ b/tests/test_workspace.py @@ -49,16 +49,18 @@ def test_api(self): meta.getparent().remove(meta) # remove img path from Page element - del result_tree.find( + res_img_path_elem = result_tree.find( ".//pc:Page", namespaces={ "pc": "http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15" }, - ).attrib["imageFilename"] - del target_tree.find( + ) + del res_img_path_elem.attrib["imageFilename"] + tar_img_path_elem = target_tree.find( ".//pc:Page", namespaces={ "pc": "http://schema.primaresearch.org/PAGE/gts/pagecontent/2019-07-15" }, - ).attrib["imageFilename"] + ) + del tar_img_path_elem.attrib["imageFilename"] assert ET.tostring(target_tree) == ET.tostring(result_tree)