diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-01-08 17:11:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-08 17:11:17 -0500 |
commit | db093b630ed487838337a04a28af79475d37d1e0 (patch) | |
tree | d78cd5fcbb4946206377a162bbcb3b7c01576d15 /cmd2/transcript.py | |
parent | 97dd6f37482510cfc424049ff0b0369b79e34335 (diff) | |
parent | 383853ee92f69c3e4ccadacd34e0f22e1e896345 (diff) | |
download | cmd2-git-db093b630ed487838337a04a28af79475d37d1e0.tar.gz |
Merge pull request #843 from python-cmd2/ansi_to_style
ansi to style
Diffstat (limited to 'cmd2/transcript.py')
-rw-r--r-- | cmd2/transcript.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd2/transcript.py b/cmd2/transcript.py index 25a79310..940c97db 100644 --- a/cmd2/transcript.py +++ b/cmd2/transcript.py @@ -56,13 +56,13 @@ class Cmd2TestCase(unittest.TestCase): def _test_transcript(self, fname: str, transcript): line_num = 0 finished = False - line = ansi.strip_ansi(next(transcript)) + line = ansi.strip_style(next(transcript)) line_num += 1 while not finished: # Scroll forward to where actual commands begin while not line.startswith(self.cmdapp.visible_prompt): try: - line = ansi.strip_ansi(next(transcript)) + line = ansi.strip_style(next(transcript)) except StopIteration: finished = True break @@ -89,7 +89,7 @@ class Cmd2TestCase(unittest.TestCase): result = self.cmdapp.stdout.read() stop_msg = 'Command indicated application should quit, but more commands in transcript' # Read the expected result from transcript - if ansi.strip_ansi(line).startswith(self.cmdapp.visible_prompt): + if ansi.strip_style(line).startswith(self.cmdapp.visible_prompt): message = '\nFile {}, line {}\nCommand was:\n{}\nExpected: (nothing)\nGot:\n{}\n'.format( fname, line_num, command, result) self.assertTrue(not (result.strip()), message) @@ -97,7 +97,7 @@ class Cmd2TestCase(unittest.TestCase): self.assertFalse(stop, stop_msg) continue expected = [] - while not ansi.strip_ansi(line).startswith(self.cmdapp.visible_prompt): + while not ansi.strip_style(line).startswith(self.cmdapp.visible_prompt): expected.append(line) try: line = next(transcript) |