• R/O
  • SSH

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

修订版5821f8fe1033bf16ee34a3b26f17d5bd53a688a2 (tree)
时间2022-02-12 06:21:13
作者Albert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

refactored a bit

更改概述

差异

diff -r b7dd492c2c77 -r 5821f8fe1033 pytst/ast/XML_serialization/__init__.py
--- a/pytst/ast/XML_serialization/__init__.py Fri Feb 11 22:15:35 2022 +0100
+++ b/pytst/ast/XML_serialization/__init__.py Fri Feb 11 22:21:13 2022 +0100
@@ -20,11 +20,13 @@
2020 assert_xml_Element(txt, tag='.//RegExpTerm', value=self.v3)
2121
2222
23-def assert_xml_Element(txt, tag, version="0.0", child_count=None, **attribs,):
23+def assert_xml_Element(txt, tag, version="0.0", child_count=None, **attribs):
2424 """Partially verify an xml-string; focusing on 'tag' -- a real tag, or a (limited) XPATH-expression.
2525
2626 This `tag` (expression) should result in a single hit!. *Use e.g `[0]` as suffix to select one from a list*.
27- Pass ``key=value`` **attribs** to verify the found tag has those attribs and values."""
27+
28+ Pass ``key=value`` **attribs** to verify the found tag has those attribs and values.
29+ Optionally, pass `child_count=INT` to verify the specified (single) tag has that number of children."""
2830
2931 tree = ET.fromstring(txt)
3032 if version:
@@ -34,10 +36,8 @@
3436 assert len(founds) == 1, f"Expected only one element; got: {len(founds)} :{founds}"
3537
3638 found = founds[0]
37- logger.debug(f'XXX1 tag={tag}:: found={found}')
3839
3940 for attrib, value in attribs.items():
40- logger.debug(f'XXX2 tag={tag}:: attrib={attrib}, value={value}')
4141 assert found.attrib[attrib] == value
4242
4343 if child_count: