mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-96175: add missing self._localName assignment in xml.dom.minidom.Attr
(GH-96176)
X-Ref: https://github.com/python/typeshed/pull/8590GH-discussion_r951473977
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 58f6953d6d
)
Co-authored-by: Kevin Kirsche <Kev.Kirsche+GitHub@gmail.com>
This commit is contained in:
parent
0aed1e71f3
commit
d7eea0f1ca
3 changed files with 18 additions and 1 deletions
|
@ -9,7 +9,7 @@ import unittest
|
|||
import pyexpat
|
||||
import xml.dom.minidom
|
||||
|
||||
from xml.dom.minidom import parse, Node, Document, parseString
|
||||
from xml.dom.minidom import parse, Attr, Node, Document, parseString
|
||||
from xml.dom.minidom import getDOMImplementation
|
||||
from xml.parsers.expat import ExpatError
|
||||
|
||||
|
@ -77,6 +77,20 @@ class MinidomTest(unittest.TestCase):
|
|||
dom.unlink()
|
||||
self.confirm(isinstance(dom, Document))
|
||||
|
||||
def testAttrModeSetsParamsAsAttrs(self):
|
||||
attr = Attr("qName", "namespaceURI", "localName", "prefix")
|
||||
self.assertEqual(attr.name, "qName")
|
||||
self.assertEqual(attr.namespaceURI, "namespaceURI")
|
||||
self.assertEqual(attr.prefix, "prefix")
|
||||
self.assertEqual(attr.localName, "localName")
|
||||
|
||||
def testAttrModeSetsNonOptionalAttrs(self):
|
||||
attr = Attr("qName", "namespaceURI", None, "prefix")
|
||||
self.assertEqual(attr.name, "qName")
|
||||
self.assertEqual(attr.namespaceURI, "namespaceURI")
|
||||
self.assertEqual(attr.prefix, "prefix")
|
||||
self.assertEqual(attr.localName, attr.name)
|
||||
|
||||
def testGetElementsByTagName(self):
|
||||
dom = parse(tstfile)
|
||||
self.confirm(dom.getElementsByTagName("LI") == \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue