FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-63882: Implement some `test_minidom` tests by StanFromIreland · Pull Request #132879 · python/cpython · GitHub

Repository navigation

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
  • Loading branch information
StanFromIreland and picnixz authored Apr 25, 2025
commit c3b759cc09ff30718ec402fb00fb0a8ef4076013
13 changes: 7 additions & 6 deletions Lib/test/test_minidom.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -395,27 +395,28 @@ def testChangeAttr(self):
and el.getAttribute("spam2") == "bam2")
dom.unlink()

def testGetAttrListAndLength(self):
def testGetAttrList(self):
dom = parseString("<abc/>")
self.addCleanup(dom.unlink)
el = dom.documentElement
el.setAttribute("spam", "jam")
self.assertEqual(len(el.attributes.items()), 1)
el.setAttribute("foo", "bar")
self.assertEqual(len(el.attributes.items()), 2)
self.assertIn(('spam', 'jam'), el.attributes.items())
self.assertIn(('foo', 'bar'), el.attributes.items())
dom.unlink()
items = el.attributes.items()
self.assertEqual(len(items), 2)
self.assertIn(('spam', 'jam'), items)
self.assertIn(('foo', 'bar'), items)

def testGetAttrValues(self):
dom = parseString("<abc/>")
self.addCleanup(dom.unlink)
el = dom.documentElement
el.setAttribute("spam", "jam")
values = [x.value for x in el.attributes.values()]
self.assertIn("jam", values)
el.setAttribute("foo", "bar")
values = [x.value for x in el.attributes.values()]
self.assertIn("bar", values)
Comment thread
StanFromIreland marked this conversation as resolved.
dom.unlink()

def testGetAttribute(self):
dom = Document()
Expand Down

Back | FazBrowse Home | New Git URL