Example #1
0
 def test_colors(self):
     color = '\033[94m'
     msg = "color"
     txt = colors.blue(msg)
     res = color + msg + "\033[0m"
     self.assertEqual(txt, res)
     color = '\033[92m'
     txt = colors.green(msg)
     res = color + msg + "\033[0m"
     self.assertEqual(txt, res)
     color = '\033[93m'
     txt = colors.yellow(msg)
     res = color + msg + "\033[0m"
     self.assertEqual(txt, res)
     color = '\033[95m'
     txt = colors.purple(msg)
     res = color + msg + "\033[0m"
     self.assertEqual(txt, res)
     color = '\033[1m'
     txt = colors.bold(msg)
     res = color + msg + "\033[0m"
     self.assertEqual(txt, res)
     color = '\033[4m'
     txt = colors.underline(msg)
     res = color + msg + "\033[0m"
     self.assertEqual(txt, res)
Example #2
0
 def debug(self, i: int = None) -> str:
     """
     Returns a debug message
     """
     head = "[" + colors.yellow("debug") + "]"
     if i is not None:
         head = str(i) + " " + head
     return head
Example #3
0
 def _assertPrintMsg(self, contains, msg_class, txt, func, *args, **kwargs):
     if msg_class == "ok":
         label = colors.green("OK")
     elif msg_class == "warning":
         label = colors.yellow("WARNING")
     elif msg_class == "info":
         label = colors.blue("INFO")
     elif msg_class == "progress":
         label = colors.purple("Progress")
     elif msg_class == "start":
         label = colors.purple("START")
     elif msg_class == "end":
         label = colors.purple("END")
     expected = ds.msg_(label, txt) + "\n"
     self._assertPrint(contains, expected, func, *args, **kwargs)
Example #4
0
 def debug(self, *msg):
     """
     Prints a warning
     """
     label = colors.yellow("DEBUG")
     self._msg(label, *msg)
Example #5
0
 def warning(self, *msg):
     """
     Prints a warning
     """
     label = colors.yellow("WARNING")
     self._msg(label, *msg)
Example #6
0
 def status(self, *msg):
     """
     Prints a status message
     """
     label = colors.yellow("STATUS")
     self._msg(label, *msg)