Esempio n. 1
0
    def test_white(self):
        with captured_output() as (out, err):
            white(ColorsTestCase.TEST_STR)

        output = out.getvalue().strip()
        self.assertEqual(
            output, '\x1b[1m\x1b[37m' + ColorsTestCase.TEST_STR +
            ColorsTestCase.RESET_CODE)
Esempio n. 2
0
    def test_ouput_is_reseted(self):
        with captured_output() as (out, err):
            _print(ColorsTestCase.TEST_STR)

        output = out.getvalue().strip()
        self.assertEqual(
            output,
            '\x1b[1m' + ColorsTestCase.TEST_STR + ColorsTestCase.RESET_CODE)
    def test_output_is_captured(self):
        test_string = "Some test string..."

        print("Some... random...")

        with captured_output() as (out, err):
            print(test_string)

        print("string outside manager...")

        output = out.getvalue().strip()
        self.assertEqual(output, test_string)
    def test_output_is_captured(self):
        test_string = "Some test string..."

        print("Some... random...")

        with captured_output() as (out, err):
            print(test_string)

        print("string outside manager...")

        output = out.getvalue().strip()
        self.assertEqual(output, test_string)
Esempio n. 5
0
    def test_white(self):
        with captured_output() as (out, err):
            white(ColorsTestCase.TEST_STR)

        output = out.getvalue().strip()
        self.assertEqual(output, '\x1b[1m\x1b[37m' + ColorsTestCase.TEST_STR + ColorsTestCase.RESET_CODE)
Esempio n. 6
0
    def test_ouput_is_reseted(self):
        with captured_output() as (out, err):
            _print(ColorsTestCase.TEST_STR)

        output = out.getvalue().strip()
        self.assertEqual(output, '\x1b[1m' + ColorsTestCase.TEST_STR + ColorsTestCase.RESET_CODE)