diff --git a/misc/qet-mcp/qet_mcp.py b/misc/qet-mcp/qet_mcp.py index a38c1e1f1..b75a0b6c2 100755 --- a/misc/qet-mcp/qet_mcp.py +++ b/misc/qet-mcp/qet_mcp.py @@ -375,7 +375,7 @@ def _extras(root: ET.Element) -> dict: for n, d in _folios(root): folios[n] = {f: d.get(f, "") for f in _FOLIO_FIELDS} folio_uuids[n] = d.get("uuid", "") - for tb in d.iter("graphics_table"): + for tb in d.findall("tables/graphics_table"): tables.append(record( tb, {"folio": n, "name": tb.get("name", "")}, {"x": tb.get("x", ""), "y": tb.get("y", ""), "width": tb.get("width", ""), diff --git a/misc/qet-mcp/test_qet_mcp.py b/misc/qet-mcp/test_qet_mcp.py index 4d7559b80..bfda00152 100644 --- a/misc/qet-mcp/test_qet_mcp.py +++ b/misc/qet-mcp/test_qet_mcp.py @@ -1305,8 +1305,8 @@ class DiffContracts(unittest.TestCase): def test_table_fields(self): def table(**v): a = {"x": "0", "y": "0", "width": "100", "height": "50", "display_n_row": "10", **v} - return ('') + return ('') for attr, reported in (("y", "y"), ("width", "width"), ("height", "height")): with self.subTest(attr=attr): d = m.tool_diff(self.qet(self.folio(extra=table())), @@ -1314,8 +1314,8 @@ class DiffContracts(unittest.TestCase): self.assertEqual([list(c["changed"]) for c in d["changed"]], [[reported]]) def test_tables(self): - table = lambda x, rows: ('') + table = lambda x, rows: ('') d = m.tool_diff(self.qet(self.folio(extra=table(0, 10))), self.qet(self.folio(extra=table(20, 12))))["tables"] self.assertEqual((d["keyed_by"], d["before"], d["after"]), ("uuid", 1, 1))