cmd2.transcript
cmd2.transcript
Machinery for running and validating transcripts.
If the user wants to run a transcript (see docs/transcript.rst), we need a mechanism to run each command in the transcript as a unit test, comparing the expected output to the actual output.
This file contains the class necessary to make that work. This class is used in cmd2.py::run_transcript_tests()
Cmd2TestCase
Bases: TestCase
A unittest class used for transcript testing.
Subclass this, setting CmdApp, to make a unittest.TestCase class that will execute the commands in a transcript file and expect the results shown.
See transcript_example.py
setUp
Instructions that will be executed before each test method.
Source code in cmd2/transcript.py
tearDown
runTest
Override of the default runTest method for the unittest.TestCase class.