예제 #1
0
    def test_should_strip_color_escapes_from_text(self, text, color):
        colored_text = colorize(text, color)
        assert text == ansi_escapes.strip_escapes(colored_text)
        assert text != colored_text

        colored_text2 = colorize(text, color) + text
        text2 = text + text
        assert text2 == ansi_escapes.strip_escapes(colored_text2)
        assert text2 != colored_text2
    def test_should_strip_color_escapes_from_text(self):
        for text in self.TEXTS:
            colored_text = self.colorize_text(text, self.ALL_COLORS)
            tools.eq_(text, ansi_escapes.strip_escapes(colored_text))
            self.assertNotEqual(text, colored_text)

            for color in self.ALL_COLORS:
                colored_text = self.colorize(text, color)
                tools.eq_(text, ansi_escapes.strip_escapes(colored_text))
                self.assertNotEqual(text, colored_text)
예제 #3
0
def CDATA(text=None):
    # -- issue #70: remove_ansi_escapes(text)
    element = ElementTree.Element('![CDATA[')
    element.text = ansi_escapes.strip_escapes(text)
    return element
예제 #4
0
파일: junit.py 프로젝트: florentx/behave
def CDATA(text=None):
    # -- issue #70: remove_ansi_escapes(text)
    element = ElementTree.Element('![CDATA[')
    element.text = ansi_escapes.strip_escapes(text)
    return element
예제 #5
0
파일: junit.py 프로젝트: bittner/behave
def CDATA(text=None):   # pylint: disable=invalid-name
    # -- issue #70: remove_ansi_escapes(text)
    element = ElementTree.Element('![CDATA[')
    element.text = ansi_escapes.strip_escapes(text)
    return element
예제 #6
0
def CDATA(text=None):  # pylint: disable=invalid-name
    # -- issue #70: remove_ansi_escapes(text)
    element = ElementTree.Element('![CDATA[')
    element.text = ansi_escapes.strip_escapes(text)
    return element
예제 #7
0
 def test_should_strip_cursor_up_escapes_from_text(self, text, cursor_up):
     colored_text = cursor_up + text + ansi_escapes.escapes["reset"]
     assert text == ansi_escapes.strip_escapes(colored_text)
     assert text != colored_text
예제 #8
0
 def test_should_strip_color_escapes_from_all_colored_text(self, text):
     colored_text = colorize_text(text, ALL_COLORS)
     assert text == ansi_escapes.strip_escapes(colored_text)
     assert text != colored_text
예제 #9
0
 def test_should_return_empty_string_for_any_ansi_escape(self, text):
     assert "" == ansi_escapes.strip_escapes(text)
예제 #10
0
 def test_should_return_same_text_without_escapes(self, text):
     assert text == ansi_escapes.strip_escapes(text)
 def test_should_strip_cursor_up_escapes_from_text(self):
     for text in self.TEXTS:
         for cursor_up in self.CURSOR_UPS:
             colored_text = cursor_up + text + ansi_escapes.escapes["reset"]
             tools.eq_(text, ansi_escapes.strip_escapes(colored_text))
             self.assertNotEqual(text, colored_text)
 def test_should_return_empty_string_for_any_ansi_escape(self):
     for text in ansi_escapes.colors.values():
         tools.eq_("", ansi_escapes.strip_escapes(text))
     for text in ansi_escapes.escapes.values():
         tools.eq_("", ansi_escapes.strip_escapes(text))
 def test_should_return_same_text_without_escapes(self):
     for text in self.TEXTS:
         tools.eq_(text, ansi_escapes.strip_escapes(text))
예제 #14
0
 def test_should_return_empty_string_for_any_ansi_escape(self):
     # XXX-JE-CHECK-PY23: If list() is really needed.
     for text in list(ansi_escapes.colors.values()):
         tools.eq_("", ansi_escapes.strip_escapes(text))
     for text in list(ansi_escapes.escapes.values()):
         tools.eq_("", ansi_escapes.strip_escapes(text))
예제 #15
0
 def test_should_return_empty_string_for_any_ansi_escape(self):
     # XXX-JE-CHECK-PY23: If list() is really needed.
     for text in list(ansi_escapes.colors.values()):
         tools.eq_("", ansi_escapes.strip_escapes(text))
     for text in list(ansi_escapes.escapes.values()):
         tools.eq_("", ansi_escapes.strip_escapes(text))