--- a/tests/config.py Sat Mar 10 19:00:12 2012 +0100
+++ b/tests/config.py Sat Mar 10 19:01:31 2012 +0100
@@ -166,3 +166,22 @@
c2.dburl = "dburl2"
self.assertFalse(c2.same(c1))
self.assertFalse(c1.same(c2))
+
+ def testSampleConf(self):
+ c1 = config.Config("1")
+ self.assertEqual(c1.sampleConf(),["[1]",
+ "# Connection URL to database",
+ "dburl = ","",
+ "# Port under that twisted is running",
+ "port = ",""])
+
+ def testsampleConfDefault(self):
+ c1 = config.Config("1")
+ c1.options["port"].default = 12345
+ c1.options["port"].must = False
+ c1.options["dburl"].default = True
+ self.assertEqual(c1.sampleConf(),["[1]",
+ "# Connection URL to database",
+ "dburl = True","",
+ "# Port under that twisted is running",
+ "# port = 12345",""])