예제 #1
0
    def test_printer_interface(self):
        uut = ColorPrinter()

        with self.assertRaises(NotImplementedError):
            uut.print("test")

        with self.assertRaises(NotImplementedError):
            uut.print("test", color="green")
예제 #2
0
    def __init__(self, print_colored=None):
        """
        Instantiates a new ConsolePrinter.

        :param print_colored: Whether to print with colors or not. If None use
                              colors if supported.
        """
        ColorPrinter.__init__(self, print_colored)
        colorama.init()
예제 #3
0
    def __init__(self, print_colored=None):
        """
        Instantiates a new ConsolePrinter.

        :param print_colored: Whether to print with colors or not. If None use
                              colors if supported.
        """
        ColorPrinter.__init__(self, print_colored)
        if not ConsolePrinter.colorama_initialized:
            colorama.init()
            ConsolePrinter.colorama_initialized = True
예제 #4
0
 def __init__(self,
              print_colored=platform.system() in ("Linux",)):
     ColorPrinter.__init__(self, print_colored)