Пример #1
0
    def testReadMapFile(self):
        c = colorizer.T()
        file = open("maps/4zebbowx.map")
        c.parse_map_file(file)
        file.close()

        self.assertEqual(len(c.gradient.segments), 255)
Пример #2
0
    def testReadBadStuff(self):
        wc = WarningCatcher()
        f = io.StringIO("""The files in this directory contain pallette files for fractint. Most
of them came from Fractint itself or the Frxtra packages for fractint
addons, and some are mine. The allmaps.zip file is a zipfile of all mapfiles
that I've ever found. The ngmap.zip is just a collection of my own
and most of them are included in the allmaps file.""")

        c = colorizer.T(wc)
        c.parse_map_file(f, 0)

        self.assertEqual(
            wc.warnings, ['Error reading colormap: No colors found'])
Пример #3
0
 def testSolids(self):
     c = colorizer.T()
     self.assertEqual([(0, 0, 0, 255)], c.solids)