From 02a050349c72612dd8e0e4d72ccbe73ff303aad6 Mon Sep 17 00:00:00 2001 From: tigro Date: Tue, 28 May 2024 17:46:18 +0300 Subject: [PATCH] Backport test_simple_xml function --- ...01-Backport-test_simple_xml-function.patch | 68 +++++++++++++++++++ SPECS/python-lxml.spec | 8 ++- 2 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 SOURCES/0001-Backport-test_simple_xml-function.patch diff --git a/SOURCES/0001-Backport-test_simple_xml-function.patch b/SOURCES/0001-Backport-test_simple_xml-function.patch new file mode 100644 index 0000000..c2c97f0 --- /dev/null +++ b/SOURCES/0001-Backport-test_simple_xml-function.patch @@ -0,0 +1,68 @@ +From dcbc52a26e661fe879e30e352103ed0fbafba908 Mon Sep 17 00:00:00 2001 +From: tigro +Date: Tue, 28 May 2024 17:42:37 +0300 +Subject: [PATCH] Backport test_simple_xml function + +--- + src/lxml/tests/test_elementtree.py | 45 +++++++++++++++--------------- + 1 file changed, 22 insertions(+), 23 deletions(-) + +diff --git a/src/lxml/tests/test_elementtree.py b/src/lxml/tests/test_elementtree.py +index 96b043d..85a1386 100644 +--- a/src/lxml/tests/test_elementtree.py ++++ b/src/lxml/tests/test_elementtree.py +@@ -4347,29 +4347,28 @@ class _XMLPullParserTest(unittest.TestCase): + self.assertEqual([(action, elem.tag) for action, elem in events], + expected) + +- def test_simple_xml(self): +- for chunk_size in (None, 1, 5): +- #with self.subTest(chunk_size=chunk_size): +- parser = self.etree.XMLPullParser() +- self.assert_event_tags(parser, []) +- self._feed(parser, "\n", chunk_size) +- self.assert_event_tags(parser, []) +- self._feed(parser, +- "\n text\n", chunk_size) +- self.assert_event_tags(parser, [('end', 'element')]) +- self._feed(parser, "texttail\n", chunk_size) +- self._feed(parser, "\n", chunk_size) +- self.assert_event_tags(parser, [ +- ('end', 'element'), +- ('end', 'empty-element'), +- ]) +- self._feed(parser, "\n", chunk_size) +- self.assert_event_tags(parser, [('end', 'root')]) +- root = self._close_and_return_root(parser) +- self.assertEqual(root.tag, 'root') ++ ++ def test_simple_xml(self, chunk_size=None): ++ parser = self.etree.XMLPullParser() ++ self.assert_event_tags(parser, []) ++ self._feed(parser, "\n", chunk_size) ++ self.assert_event_tags(parser, []) ++ self._feed(parser, ++ "\n text\n", chunk_size) ++ self._feed(parser, "texttail\n", chunk_size) ++ self._feed(parser, "\n", chunk_size) ++ self._feed(parser, "\n", chunk_size) ++ self.assert_event_tags(parser, [ ++ ('end', 'element'), ++ ('end', 'element'), ++ ('end', 'empty-element'), ++ ('end', 'root'), ++ ]) ++ root = self._close_and_return_root(parser) ++ self.assertEqual(root.tag, 'root') + + def test_feed_while_iterating(self): + parser = self.etree.XMLPullParser() +-- +2.45.1 + diff --git a/SPECS/python-lxml.spec b/SPECS/python-lxml.spec index 84d09dd..4237b32 100644 --- a/SPECS/python-lxml.spec +++ b/SPECS/python-lxml.spec @@ -2,13 +2,16 @@ Name: python-%{modname} Version: 4.6.5 -Release: 1%{?dist} +Release: 1%{?dist}.inferit Summary: XML processing library combining libxml2/libxslt with the ElementTree API License: BSD URL: https://github.com/lxml/lxml Source0: %{pypi_source %{modname}} +# Adapt a test to a behavioural change in libxml2 2.9.11+ +Patch1: 0001-Backport-test_simple_xml-function.patch + # Exclude i686 arch. Due to a modularity issue it's being added to the # x86_64 compose of CRB, but we don't want to ship it at all. # See: https://projects.engineering.redhat.com/browse/RCM-72605 @@ -68,6 +71,9 @@ cp -a build/lib.%{python3_platform}-%{python3_version}/* src/ %{python3_sitearch}/%{modname}-*.egg-info/ %changelog +* Tue May 28 2024 Arkady L. Shane - 4.6.5-1.inferit +- Backport test_simple_xml function + * Wed Apr 03 2024 MSVSphere Packaging Team - 4.6.5-1 - Rebuilt for MSVSphere 8.10 beta