예제 #1
0
    def testNonExistentEntryInColorMap(self):
        with patch('vai.paths.pluginsDir') as mock:
            mock.return_value = fixtures.localDir()

            schema = SyntaxColors("default", 8)
            color_map = schema.colorMap()
            self.assertTrue(isinstance(color_map["whatever"], tuple))
            self.assertEqual(len(color_map["whatever"]), 3)
            self.assertTrue(all([ x is None for x in color_map["whatever"]]))
예제 #2
0
    def testExistentNonEmpty(self):
        with patch('vai.paths.pluginsDir') as mock:
            mock.return_value = fixtures.localDir()

            schema = SyntaxColors("DeepBlue", 8)
            color_map = schema.colorMap()
            self.assertIsNotNone(color_map)
            self.assertEqual(len(color_map), 1)
            self.assertTrue(isinstance(color_map[token.Keyword], tuple))
            self.assertEqual(len(color_map[token.Keyword]), 3)