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

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

Issue 16510: Using appropriate checks in tests
Patch Set: Created 5 years, 6 months 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 run_unittest, findfile 4 from test.support import 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 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after
1518 doc2 = parseString(doc.toxml()) 1518 doc2 = parseString(doc.toxml())
1519 self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE) 1519 self.confirm(doc2.namespaceURI == xml.dom.EMPTY_NAMESPACE)
1520 1520
1521 def testDocRemoveChild(self): 1521 def testDocRemoveChild(self):
1522 doc = parse(tstfile) 1522 doc = parse(tstfile)
1523 title_tag = doc.documentElement.getElementsByTagName("TITLE")[0] 1523 title_tag = doc.documentElement.getElementsByTagName("TITLE")[0]
1524 self.assertRaises( xml.dom.NotFoundErr, doc.removeChild, title_tag) 1524 self.assertRaises( xml.dom.NotFoundErr, doc.removeChild, title_tag)
1525 num_children_before = len(doc.childNodes) 1525 num_children_before = len(doc.childNodes)
1526 doc.removeChild(doc.childNodes[0]) 1526 doc.removeChild(doc.childNodes[0])
1527 num_children_after = len(doc.childNodes) 1527 num_children_after = len(doc.childNodes)
1528 self.assertTrue(num_children_after == num_children_before - 1) 1528 self.assertEqual(num_children_after, num_children_before - 1)
1529 1529
1530 def test_main(): 1530 def test_main():
1531 run_unittest(MinidomTest) 1531 run_unittest(MinidomTest)
1532 1532
1533 if __name__ == "__main__": 1533 if __name__ == "__main__":
1534 test_main() 1534 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+