diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-09 22:45:53 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-01-09 22:45:53 -0500 |
commit | 591bd29cb4a3bcb9b1f40ffc1f30429c6501ebdb (patch) | |
tree | 46c1e3af762c9cb222c6ae90bf0446d6eca4b388 /cmd2/transcript.py | |
parent | 10b844809e3a9500274dc4af4e780708975ba905 (diff) | |
parent | d4556962799e68ea4d54ff86186428d17edcaef9 (diff) | |
download | cmd2-git-591bd29cb4a3bcb9b1f40ffc1f30429c6501ebdb.tar.gz |
Merge branch 'master' into generating_output_docs
# Conflicts:
# docs/features/generating_output.rst
# docs/features/settings.rst
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) |