Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP1:GA
python-lxml
fix-test-failures.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-test-failures.patch of Package python-lxml
Index: lxml-4.0.0/src/lxml/tests/test_etree.py =================================================================== --- lxml-4.0.0.orig/src/lxml/tests/test_etree.py +++ lxml-4.0.0/src/lxml/tests/test_etree.py @@ -209,7 +209,7 @@ class ETreeOnlyTestCase(HelperTestCase): qname2 = QName(a) self.assertEqual(a.tag, qname1.text) self.assertEqual(qname1.text, qname2.text) - self.assertEqual(qname1, qname2) + self.assertEqual(str(qname1), str(qname2)) def test_qname_text_resolve(self): # ET doesn't resove QNames as text values @@ -914,9 +914,10 @@ class ETreeOnlyTestCase(HelperTestCase): self.assertEqual(len(root), 1) self.assertEqual(root[0].tag, "a") self.assertEqual(root[0].get("test"), "works") - self.assertEqual(root[0].attrib, { - 'test': 'works', - '{http://www.w3.org/XML/1998/namespace}id': '321'}) + self.assertEqual( + root[0].attrib.keys(), + ['test', '{http://www.w3.org/XML/1998/namespace}id']) + self.assertEqual(root[0].attrib.values(), ['works', '321']) self.assertEqual(len(root[0]), 1) self.assertEqual(root[0][0].tag, "othertag") # FIXME: would be nice to get some errors logged ... @@ -1367,10 +1368,10 @@ class ETreeOnlyTestCase(HelperTestCase): xml = _str('<!DOCTYPE a SYSTEM "%s"><a><b/></a>') % test_url tree = parse(StringIO(xml), parser) root = tree.getroot() - self.assertEqual( - root.attrib, {'default': 'valueA'}) - self.assertEqual( - root[0].attrib, {'default': 'valueB'}) + self.assertEqual(root.attrib.keys(), ['default']) + self.assertEqual(root.attrib.values(), ['valueA']) + self.assertEqual(root[0].attrib.keys(), ['default']) + self.assertEqual(root[0].attrib.values(), ['valueB']) def test_resolve_filename_dtd_relative(self): parse = self.etree.parse @@ -1393,10 +1394,10 @@ class ETreeOnlyTestCase(HelperTestCase): tree = parse(StringIO(xml), parser, base_url=fileUrlInTestDir('__test.xml')) root = tree.getroot() - self.assertEqual( - root.attrib, {'default': 'valueA'}) - self.assertEqual( - root[0].attrib, {'default': 'valueB'}) + self.assertEqual(root.attrib.keys(), ['default']) + self.assertEqual(root.attrib.values(), ['valueA']) + self.assertEqual(root[0].attrib.keys(), ['default']) + self.assertEqual(root[0].attrib.values(), ['valueB']) def test_resolve_file_dtd(self): parse = self.etree.parse @@ -1415,10 +1416,10 @@ class ETreeOnlyTestCase(HelperTestCase): xml = _str('<!DOCTYPE a SYSTEM "%s"><a><b/></a>') % test_url tree = parse(StringIO(xml), parser) root = tree.getroot() - self.assertEqual( - root.attrib, {'default': 'valueA'}) - self.assertEqual( - root[0].attrib, {'default': 'valueB'}) + self.assertEqual(root.attrib.keys(), ['default']) + self.assertEqual(root.attrib.values(), ['valueA']) + self.assertEqual(root[0].attrib.keys(), ['default']) + self.assertEqual(root[0].attrib.values(), ['valueB']) def test_resolve_empty(self): parse = self.etree.parse Index: lxml-4.0.0/src/lxml/tests/test_elementtree.py =================================================================== --- lxml-4.0.0.orig/src/lxml/tests/test_elementtree.py +++ lxml-4.0.0/src/lxml/tests/test_elementtree.py @@ -3359,10 +3359,10 @@ class _ETreeTestCaseBase(HelperTestCase) etree = self.etree qname1 = etree.QName('myns', 'a') qname2 = etree.QName('myns', 'a') - self.assertEqual(qname1, "{myns}a") - self.assertEqual("{myns}a", qname2) - self.assertEqual(qname1, qname1) - self.assertEqual(qname1, qname2) + self.assertEqual(str(qname1), "{myns}a") + self.assertEqual("{myns}a", str(qname2)) + self.assertEqual(str(qname1), str(qname1)) + self.assertEqual(str(qname1), str(qname2)) def test_qname_attribute_getset(self): etree = self.etree @@ -3796,15 +3796,18 @@ class _ETreeTestCaseBase(HelperTestCase) builder = self.etree.TreeBuilder() el = builder.start("root", {'a':'A', 'b':'B'}) self.assertEqual("root", el.tag) - self.assertEqual({'a':'A', 'b':'B'}, el.attrib) + self.assertEqual(sorted(el.attrib.keys()), ['a', 'b']) + self.assertEqual(sorted(el.attrib.values()), ['A', 'B']) builder.data("ROOTTEXT") el = builder.start("child", {'x':'X', 'y':'Y'}) self.assertEqual("child", el.tag) - self.assertEqual({'x':'X', 'y':'Y'}, el.attrib) + self.assertEqual(sorted(el.attrib.keys()), ['x', 'y']) + self.assertEqual(sorted(el.attrib.values()), ['X', 'Y']) builder.data("CHILDTEXT") el = builder.end("child") self.assertEqual("child", el.tag) - self.assertEqual({'x':'X', 'y':'Y'}, el.attrib) + self.assertEqual(sorted(el.attrib.keys()), ['x', 'y']) + self.assertEqual(sorted(el.attrib.values()), ['X', 'Y']) self.assertEqual("CHILDTEXT", el.text) self.assertEqual(None, el.tail) builder.data("CHILDTAIL")
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor