예제 #1
0
 def test_color_multiple_lines(self):
     expected = textwrap.dedent('''\
                    \x1b[1;32mHere is some text
                    \x1b[1;0m\x1b[1;32mThat is on multiple lines
                    \x1b[1;0m\x1b[1;32mthree lines to be exact.\x1b[1;0m''')
     assert in_color('green', self.multi_line) == expected
예제 #2
0
 def test_color_multiple_lines(self):
     expected = textwrap.dedent('''\
                    \x1b[1;32mHere is some text
                    \x1b[1;0m\x1b[1;32mThat is on multiple lines
                    \x1b[1;0m\x1b[1;32mthree lines to be exact.\x1b[1;0m''')
     assert in_color('green', self.multi_line) == expected
예제 #3
0
 def test_color_one_line(self):
     assert in_color('green', self.single_line) == '\x1b[1;32mHere is a single line of text.\x1b[1;0m'
예제 #4
0
 def test_color_one_line(self):
     assert in_color(
         'green', self.single_line
     ) == '\x1b[1;32mHere is a single line of text.\x1b[1;0m'