コード例 #1
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testWhitespace3(self):
   lb = LineBuffer()
   lb.append("x=42\n")
   dict = { "x" : "42" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))
コード例 #2
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testEscape1(self):
   lb = LineBuffer()
   lb.append("x=4\\t2\n")
   dict = { "x" : "4\t2" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))
コード例 #3
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testEmptyProperty3(self):
   lb = LineBuffer()
   lb.append("x=       \n")
   dict = { "x" : "" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))
コード例 #4
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testKeyEscape2(self):
   lb = LineBuffer()
   lb.append("x\\ y=42\n")
   dict = { "x y" : "42" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))
コード例 #5
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testLineContinue(self):
   lb = LineBuffer()
   lb.append("x=42   \\\n")
   lb.append("        boo\n")
   dict = { "x" : "42   boo" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))
コード例 #6
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testOverwrite(self):
   lb = LineBuffer()
   lb.append("x=42\n")
   lb.append("x=44\n")
   dict = { "x" : "44" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))
コード例 #7
0
ファイル: propertiestest.py プロジェクト: kimballa/stitch
 def testIgnoreBlanks(self):
   lb = LineBuffer()
   lb.append("\n")
   lb.append("x=42\n")
   lb.append("                 \n")
   lb.append("    # comment\n")
   dict = { "x" : "42" }
   p = Properties()
   p.load(lb)
   self.assertTrue(p.equalsDict(dict))