Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14691)

Side by Side Diff: Lib/test/test_minidom.py

Issue 16510: Using appropriate checks in tests
Patch Set: Created 6 years ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_memoryview.py ('k') | Lib/test/test_module.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # test for xml.dom.minidom 1 # test for xml.dom.minidom
2 2
3 import pickle 3 import pickle
4 from test.support import verbose, run_unittest, findfile 4 from test.support import verbose, run_unittest, findfile
5 import unittest 5 import unittest
6 6
7 import xml.dom.minidom 7 import xml.dom.minidom
8 8
9 from xml.dom.minidom import parse, Node, Document, parseString 9 from xml.dom.minidom import parse, Node, Document, parseString
10 from xml.dom.minidom import getDOMImplementation 10 from xml.dom.minidom import getDOMImplementation
(...skipping 1506 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 doc2 = parseString(doc.toxml()) 1517 doc2 = parseString(doc.toxml())
1518 self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE) 1518 self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
1519 1519
1520 def testDocRemoveChild(self): 1520 def testDocRemoveChild(self):
1521 doc = parse(tstfile) 1521 doc = parse(tstfile)
1522 title_tag = doc.documentElement.getElementsByTagName("TITLE")[0] 1522 title_tag = doc.documentElement.getElementsByTagName("TITLE")[0]
1523 self.assertRaises( xml.dom.NotFoundErr, doc.removeChild, title_tag) 1523 self.assertRaises( xml.dom.NotFoundErr, doc.removeChild, title_tag)
1524 num_children_before = len(doc.childNodes) 1524 num_children_before = len(doc.childNodes)
1525 doc.removeChild(doc.childNodes[0]) 1525 doc.removeChild(doc.childNodes[0])
1526 num_children_after = len(doc.childNodes) 1526 num_children_after = len(doc.childNodes)
1527 self.assertTrue(num_children_after == num_children_before - 1) 1527 self.assertEqual(num_children_after, num_children_before - 1)
1528 1528
1529 def test_main(): 1529 def test_main():
1530 run_unittest(MinidomTest) 1530 run_unittest(MinidomTest)
1531 1531
1532 if __name__ == "__main__": 1532 if __name__ == "__main__":
1533 test_main() 1533 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_memoryview.py ('k') | Lib/test/test_module.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+