XML比较工具
项目描述
从FormEncode和strainer中提取,仅为了支持Python 2和3。旨在用于您的webapp测试套件中。
构建状态
分支 |
状态 |
---|---|
master |
|
develop |
例如
您可能关心的两个主要功能是:eq_xml和in_xml
>>> from sieve.operators import eq_xml, in_xml >>> a = "<foo><bar>Value</bar></foo>" >>> b = """ ... <foo> ... <bar> ... Value ... </bar> ... </foo> ... """ >>> eq_xml(a, b) True >>> c = "<html><body><foo><bar>Value</bar></foo></body></html" >>> in_xml(a, c) # 'needle' in a 'haystack' True
还有两个同级便利函数:assert_eq_xml和assert_in_xml。