tests/config.py
branchdevel
changeset 220 602720314930
parent 188 4d6130d91e56
equal deleted inserted replaced
219:4e9d79c35088 220:602720314930
   164         self.assertFalse(c1.same(c2))
   164         self.assertFalse(c1.same(c2))
   165         c2.port = 1
   165         c2.port = 1
   166         c2.dburl = "dburl2"
   166         c2.dburl = "dburl2"
   167         self.assertFalse(c2.same(c1))
   167         self.assertFalse(c2.same(c1))
   168         self.assertFalse(c1.same(c2))
   168         self.assertFalse(c1.same(c2))
       
   169 
       
   170     def testSampleConf(self):
       
   171         c1 = config.Config("1")
       
   172         self.assertEqual(c1.sampleConf(),["[1]",
       
   173             "# Connection URL to database",
       
   174             "dburl = ","",
       
   175             "# Port under that twisted is running",
       
   176             "port = ",""])
       
   177 
       
   178     def testsampleConfDefault(self):
       
   179         c1 = config.Config("1")
       
   180         c1.options["port"].default = 12345
       
   181         c1.options["port"].must = False
       
   182         c1.options["dburl"].default = True
       
   183         self.assertEqual(c1.sampleConf(),["[1]",
       
   184             "# Connection URL to database",
       
   185             "dburl = True","",
       
   186             "# Port under that twisted is running",
       
   187             "# port = 12345",""])