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)
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)
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)
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)