Example #1
0
 def testTermcolorFalse(self):
     """
     termcolor=False results in no terminal output
     """
     c = Colors(termcolor=False)
     self.assertFalse(c.termcolor)
     self.assertFalse(len(c.bold("")) > 0)
Example #2
0
 def testTermcolorTrue(self):
     """
     termcolor=True results in terminal output
     """
     c = Colors(termcolor=True)
     self.assertTrue(c.termcolor)
     self.assertTrue(len(c.bold("")) > 0)
Example #3
0
 def testUp(self):
     """
     calling up gives us a non-blank string
     """
     c = Colors()
     up = c.up()
     self.assertEqual(type(up), str)
     self.assertNotEqual(up, '')
Example #4
0
 def testTermstyleColorsDoNotCrash(self):
     """
     termstyle-based colors don't crash and output something
     """
     c = Colors(termcolor=True)
     for func in [c.bold, c.blue, c.fetchdata, c.red, c.yellow, c.passing,
             c.failing, c.error, c.skipped, c.unexpectedSuccess,
             c.expectedFailure, c.moduleName]:
         self.assertTrue(len(func("")) > 0)
     # c.className is a special case
     c.className("")