mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576)
This commit is contained in:
parent
10cb3760e8
commit
a6dc531063
4 changed files with 38 additions and 5 deletions
|
@ -254,6 +254,34 @@ class MakeParserTest(unittest.TestCase):
|
|||
from xml.sax import make_parser
|
||||
p = make_parser()
|
||||
|
||||
def test_make_parser3(self):
|
||||
# Testing that make_parser can handle different types of
|
||||
# iterables.
|
||||
make_parser(['module'])
|
||||
make_parser(('module', ))
|
||||
make_parser({'module'})
|
||||
make_parser(frozenset({'module'}))
|
||||
make_parser({'module': None})
|
||||
make_parser(iter(['module']))
|
||||
|
||||
def test_make_parser4(self):
|
||||
# Testing that make_parser can handle empty iterables.
|
||||
make_parser([])
|
||||
make_parser(tuple())
|
||||
make_parser(set())
|
||||
make_parser(frozenset())
|
||||
make_parser({})
|
||||
make_parser(iter([]))
|
||||
|
||||
def test_make_parser5(self):
|
||||
# Testing that make_parser can handle iterables with more than
|
||||
# one item.
|
||||
make_parser(['module1', 'module2'])
|
||||
make_parser(('module1', 'module2'))
|
||||
make_parser({'module1', 'module2'})
|
||||
make_parser(frozenset({'module1', 'module2'}))
|
||||
make_parser({'module1': None, 'module2': None})
|
||||
make_parser(iter(['module1', 'module2']))
|
||||
|
||||
# ===========================================================================
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue