diff options
author | Brett Cannon <brett@python.org> | 2012-03-06 20:33:24 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-03-06 20:33:24 (GMT) |
commit | f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24 (patch) | |
tree | ceed84488164142e5884411566de19f66702c3e7 /Lib/test/test_xml_etree_c.py | |
parent | 0d4d410b2d6891520b1772a85f5ebdf926a0c77e (diff) | |
parent | 0119e4753eec50f671ee716af202b4a1ca28deef (diff) | |
download | cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.zip cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.tar.gz cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.tar.bz2 |
merge
Diffstat (limited to 'Lib/test/test_xml_etree_c.py')
-rw-r--r-- | Lib/test/test_xml_etree_c.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/Lib/test/test_xml_etree_c.py b/Lib/test/test_xml_etree_c.py index a73d0c4..10416d2 100644 --- a/Lib/test/test_xml_etree_c.py +++ b/Lib/test/test_xml_etree_c.py @@ -47,13 +47,20 @@ class MiscTests(unittest.TestCase): data = None @unittest.skipUnless(cET, 'requires _elementtree') +class TestAliasWorking(unittest.TestCase): + # Test that the cET alias module is alive + def test_alias_working(self): + e = cET_alias.Element('foo') + self.assertEqual(e.tag, 'foo') + +@unittest.skipUnless(cET, 'requires _elementtree') class TestAcceleratorImported(unittest.TestCase): # Test that the C accelerator was imported, as expected def test_correct_import_cET(self): - self.assertEqual(cET.Element.__module__, '_elementtree') + self.assertEqual(cET.SubElement.__module__, '_elementtree') def test_correct_import_cET_alias(self): - self.assertEqual(cET_alias.Element.__module__, '_elementtree') + self.assertEqual(cET_alias.SubElement.__module__, '_elementtree') def test_main(): @@ -61,13 +68,15 @@ def test_main(): # Run the tests specific to the C implementation support.run_doctest(test_xml_etree_c, verbosity=True) - - support.run_unittest(MiscTests, TestAcceleratorImported) + support.run_unittest( + MiscTests, + TestAliasWorking, + TestAcceleratorImported + ) # Run the same test suite as the Python module test_xml_etree.test_main(module=cET) - # Exercise the deprecated alias - test_xml_etree.test_main(module=cET_alias) + if __name__ == '__main__': test_main() |