From 366950e6ff9362edee105858a4ada93f2517da3d Mon Sep 17 00:00:00 2001 From: Oliver Gerlich Date: Tue, 4 Mar 2008 22:52:12 +0100 Subject: [PATCH] add comments for test cases The new comments are displayed when running the tests. Also, a debugging output in a test was removed. --- xmldict.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/xmldict.py b/xmldict.py index b7615cf..6e710ec 100644 --- a/xmldict.py +++ b/xmldict.py @@ -178,6 +178,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(d["tag1"].data, "text") def testOneEmptyTag1(self): + "one tag without content (short notation)" d = builddict("") self.assertEqual(len(d), 1) self.assertEqual(d["tag1"].name, "tag1") @@ -185,6 +186,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(d["tag1"].data, "") def testOneEmptyTag2(self): + "one tag without content (short notation); with in-tag whitespace" d = builddict("") self.assertEqual(len(d), 1) self.assertEqual(d["tag1"].name, "tag1") @@ -192,6 +194,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(d["tag1"].data, "") def testTwoNestedTagsWithContent1(self): + "two nested tags, with content" d = builddict("joenickjohn") self.assertEqual(len(d), 1) self.assertEqual(d["group"].name, "group") @@ -211,6 +214,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(d["group"]["user"][2].data, "john") def testTwoNestedEmptyTags1(self): + "two nested tags, short notation" d = builddict("") self.assertEqual(len(d), 1) self.assertEqual(d["group"].name, "group") @@ -236,6 +240,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(str(d["group"]["user"][0]), str(d["group"]["user"][3])) def testTwoNestedEmptyTags2(self): + "two nested tags, short notation, different tag names" d = builddict("") self.assertEqual(len(d), 1) self.assertEqual(d["users"].name, "users") @@ -254,6 +259,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(d["users"]["john"].data, "") def testThreeNestedTags1(self): + "three nested tags, one with short notation, one with content" d = builddict("cont3") self.assertEqual(len(d), 1) self.assertEqual(d["tag1"].name, "tag1") @@ -270,6 +276,7 @@ class XMLTest(unittest.TestCase): def testThreeNestedTags2(self): + "three nested tags, one with short notation and in-tag whitespace, one with content" d = builddict("cont3") self.assertEqual(len(d), 1) self.assertEqual(d["tag1"].name, "tag1") @@ -286,6 +293,7 @@ class XMLTest(unittest.TestCase): def testOneTagWithAttr1(self): + "tag with attribute and single quotes" d = builddict("text") self.assertEqual(len(d), 1) self.assertEqual(d["tag1"].name, "tag1") @@ -293,6 +301,7 @@ class XMLTest(unittest.TestCase): self.assertEqual(d["tag1"].data, "text") def testOneTagWithAttr2(self): + "tag with attribute and double quotes" d = builddict('text') self.assertEqual(len(d), 1) self.assertEqual(d["tag1"].name, "tag1") @@ -301,6 +310,7 @@ class XMLTest(unittest.TestCase): def testRealContent1(self): + "short DAV XML" d = builddict(""" """) @@ -322,6 +332,7 @@ class XMLTest(unittest.TestCase): def testRealContent2(self): + "longer DAV XML" d = builddict(""" @@ -331,7 +342,6 @@ class XMLTest(unittest.TestCase): """) - print d.prettyPrint() self.assertEqual(len(d), 1) self.assertEqual(d["propfind"].name, "propfind") self.assertEqual(d["propfind"].attrs, {"xmlns" : "DAV:"}) -- 2.11.4.GIT