Exemplo n.º 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")
Exemplo n.º 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()
Exemplo n.º 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
Exemplo n.º 4
0
 def __init__(self,
              print_colored=platform.system() in ("Linux",)):
     ColorPrinter.__init__(self, print_colored)