コード例 #1
0
 def test_itHandlesEverythingElse(self):
     fileList = ["a.tif",
                 "ampersand.png",
                 "bulubu.png",
                 "Dswash.png"]
     result = parseFiles(self.fullPath, fileList)
     self.assertEquals(result, {"ampersand": "/home/robo/images/ampersand.png",
                                "bulubu": "/home/robo/images/bulubu.png",
                                "Dswash": "/home/robo/images/Dswash.png" })
コード例 #2
0
 def test_itHandlesNumbers(self):
     fileList = ["num-0.png",
                 "num-10.png",
                 "num-zero.png",
                 "num-FIVE.png",
                 "num-four.png"]
     result = parseFiles(self.fullPath, fileList)
     self.assertEquals(result, {"zero": "/home/robo/images/num-zero.png",
                                "four": "/home/robo/images/num-four.png"})
コード例 #3
0
 def test_itHandlesUpperCaseLetters(self):
     fileList = ["UC-B.png",
                 "uC-C.png",
                 "UC-INVALIDGLYPHNAME.png",
                 "UC-A-acute.png",
                 "UC-AE.tif"]
     result = parseFiles(self.fullPath, fileList)
     self.assertEquals(result, {"B": "/home/robo/images/UC-B.png",
                                "Aacute": "/home/robo/images/UC-A-acute.png",
                                "AE": "/home/robo/images/UC-AE.tif"})
コード例 #4
0
 def test_itHandlesLowerCaseLetters(self):
     fileList = ["lc-b.png",
                 "lC-A.png",
                 "lc-invalidglyphname.png",
                 "lc-a-acute.png",
                 "lc-ae.tif",
                 "lc-ui.tif"]
     result = parseFiles(self.fullPath, fileList)
     self.assertEquals(result, {"b": "/home/robo/images/lc-b.png",
                                "aacute": "/home/robo/images/lc-a-acute.png",
                                "ae": "/home/robo/images/lc-ae.tif",
                                "ui": "/home/robo/images/lc-ui.tif"})
コード例 #5
0
 def test_itFiltersInvalidFileExtensions(self):
 	fileList = ["lc-b.txt",
 				"lc-a.doc",
 				"lc-a.ai"]
 	result = parseFiles(self.fullPath, fileList)
 	self.assertEquals(len(result), 0)
コード例 #6
0
 def test_itReturnsADictionary(self):
     result = parseFiles(self.fullPath, [])
     self.assertTrue( isinstance(result, dict))