Backport test_simple_xml function

i8-beta-stream-3.9 changed/i8-beta-stream-3.9/python-lxml-4.6.5-1.module+el8.9.0+19644+d68f775d.inferit
Arkady L. Shane 9 months ago
parent af79eae593
commit 02a050349c
Signed by: tigro
GPG Key ID: 1EC08A25C9DB2503

@ -0,0 +1,68 @@
From dcbc52a26e661fe879e30e352103ed0fbafba908 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
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, "<!-- comment -->\n", chunk_size)
- self.assert_event_tags(parser, [])
- self._feed(parser,
- "<root>\n <element key='value'>text</element",
- chunk_size)
- self.assert_event_tags(parser, [])
- self._feed(parser, ">\n", chunk_size)
- self.assert_event_tags(parser, [('end', 'element')])
- self._feed(parser, "<element>text</element>tail\n", chunk_size)
- self._feed(parser, "<empty-element/>\n", chunk_size)
- self.assert_event_tags(parser, [
- ('end', 'element'),
- ('end', 'empty-element'),
- ])
- self._feed(parser, "</root>\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, "<!-- comment -->\n", chunk_size)
+ self.assert_event_tags(parser, [])
+ self._feed(parser,
+ "<root>\n <element key='value'>text</element",
+ chunk_size)
+ self.assert_event_tags(parser, [])
+ self._feed(parser, ">\n", chunk_size)
+ self._feed(parser, "<element>text</element>tail\n", chunk_size)
+ self._feed(parser, "<empty-element/>\n", chunk_size)
+ self._feed(parser, "</root>\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

@ -2,13 +2,16 @@
Name: python-%{modname} Name: python-%{modname}
Version: 4.6.5 Version: 4.6.5
Release: 1%{?dist} Release: 1%{?dist}.inferit
Summary: XML processing library combining libxml2/libxslt with the ElementTree API Summary: XML processing library combining libxml2/libxslt with the ElementTree API
License: BSD License: BSD
URL: https://github.com/lxml/lxml URL: https://github.com/lxml/lxml
Source0: %{pypi_source %{modname}} 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 # 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. # x86_64 compose of CRB, but we don't want to ship it at all.
# See: https://projects.engineering.redhat.com/browse/RCM-72605 # 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/ %{python3_sitearch}/%{modname}-*.egg-info/
%changelog %changelog
* Tue May 28 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 4.6.5-1.inferit
- Backport test_simple_xml function
* Wed Apr 03 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 4.6.5-1 * Wed Apr 03 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 4.6.5-1
- Rebuilt for MSVSphere 8.10 beta - Rebuilt for MSVSphere 8.10 beta

Loading…
Cancel
Save