diff options
author | Andrés Delfino <adelfino@gmail.com> | 2018-10-26 14:56:57 (GMT) |
---|---|---|
committer | Tal Einat <taleinat+github@gmail.com> | 2018-10-26 14:56:57 (GMT) |
commit | a6dc531063efe3a8d47ff4639729060c72a3688c (patch) | |
tree | 25f8f3c4a7883783103a4c6d73ee117aa50dc187 /Lib/test | |
parent | 10cb3760e8631a27f5db1e51b05494e29306c671 (diff) | |
download | cpython-a6dc531063efe3a8d47ff4639729060c72a3688c.zip cpython-a6dc531063efe3a8d47ff4639729060c72a3688c.tar.gz cpython-a6dc531063efe3a8d47ff4639729060c72a3688c.tar.bz2 |
bpo-34789: make xml.sax.make_parser accept iterables of all types (GH-9576)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_sax.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Lib/test/test_sax.py b/Lib/test/test_sax.py index 3044960..894d86a 100644 --- a/Lib/test/test_sax.py +++ b/Lib/test/test_sax.py @@ -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'])) # =========================================================================== # |