summaryrefslogtreecommitdiff
path: root/tests/test_transcript.py
Commit message (Collapse)AuthorAgeFilesLines
* Deprecate support for Python 3.6 and remove dependency on attrs (#1257)Todd Leonhardt2023-01-311-1/+0
| | | | | | | | | | | | | * Start deprecation of Python 3.6 * Removed dependency on attrs and replaced with dataclasses * Fix typing * Added comments to assist with dropping support of Python versions in the future. --------- Co-authored-by: Kevin Van Brunt <kmvanbrunt@gmail.com>
* Fixing tests on Python 3.10Kevin Van Brunt2021-06-171-3/+2
|
* Replaced some pexcept() calls with perror().Kevin Van Brunt2021-04-021-17/+10
| | | | | | Converted some strings to f-strings. Fixed some grammar in error messages and docs. Increased code coverage.
* Resolves comments from PREric Lin2021-03-181-1/+1
|
* Add in isort changesTodd Leonhardt2021-01-311-2/+6
|
* Add black for automatic code formatTodd Leonhardt2021-01-311-48/+53
|
* Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-221-5/+15
| | | | minor import changes.
* Marked with_arparser_and_unknown_args deprecated and consolidatedEric Lin2020-08-041-2/+3
| | | | implementation as an option to with_argparser instead.
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-241-5/+6
| | | | | | | Also: - Added isort to Pipenv dev - Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke - Ran isort to sort includes
* Add unit tests for Ctrl-C stopping scripts/transcriptsKevin Van Brunt2020-03-261-0/+9
|
* Updated set command to support tab completion of valuesKevin Van Brunt2020-02-041-2/+2
|
* No longer printing all help text for alias and macro when the subcommand is ↵Kevin Van Brunt2019-09-171-2/+2
| | | | omitted. Instead allow argparse to handle the error.
* Added verify_help_text() helper function for tests and removed BASE_HELP and ↵Todd Leonhardt2019-06-151-4/+3
| | | | | | BASE_HELP_VERBOSE constants The tests are now much more resilient to adding, removing, or renaming commands
* Updated various documentation and tests to not use loadTodd Leonhardt2019-06-151-3/+3
|
* Updated unit testKevin Van Brunt2019-06-121-4/+3
|
* Transcript generation no longer terminates _cmdloop() when a command returns ↵Kevin Van Brunt2019-06-121-4/+3
| | | | True for stop
* Fixed unit testsKevin Van Brunt2019-06-121-18/+20
|
* Removed support for cmd.cmdqueueKevin Van Brunt2019-06-111-17/+15
| | | | allow_cli_args is now an argument to __init__ instead of a cmd2 class member
* Added unit test for stopping during transcript generationKevin Van Brunt2019-06-101-0/+23
|
* Removed copyright headers from source files and updated LICENSE with current ↵Kevin Van Brunt2019-06-071-3/+0
| | | | year
* Refactored how and when transcript file glob patterns are expanded in order ↵Todd Leonhardt2019-06-061-1/+20
| | | | to present a better error message to user
* Modified transcript testing so that the useless exception trackeback isn't ↵Todd Leonhardt2019-05-211-2/+2
| | | | printed in failure cases
* Refactor exit_code implementationTodd Leonhardt2019-05-201-1/+28
| | | | | | | | | | | | cmd2.Cmd.cmdloop() now returns self.exit_code which should be an integer Also: - Refactored examples to call sys.exit(app.cmdloop()) in their __main__ - Running transcript tests now sets the exit_code accordingly based on success/failure - Updated CHANGELOG - Updated README - Updated Sphinx docs - Added unit test for case when transcript test fails
* Now consistently use -t flag for transcript generation for both history and ↵Todd Leonhardt2019-03-191-1/+1
| | | | load commands
* Updated CHANGELOGTodd Leonhardt2019-03-191-2/+2
| | | | | | Also: - Removed guard clauses which kmvanbrunt promises will be unecessary with his upcoming change - Moved transcript path validation inside _generate_transcript()
* Merge branch 'master' into load_generate_transcriptTodd Leonhardt2019-03-181-2/+1
|\
| * First stage of attribute refactoringTodd Leonhardt2019-03-131-2/+1
| | | | | | | | | | | | | | | | | | | | The following are now arguments to cmd2.Cmd.__init__() instead of class attributes: * allow_redirection * multiline_commands * terminators * shortcuts Added a couple read-only properties for convenience of cmd2.Cmd accessing immutable members from self.statement_parser
* | Added a unit test for "load -r"Todd Leonhardt2019-03-181-1/+30
|/
* Clean up unused variableskotfu2019-03-091-2/+2
|
* Changed examples to reflect that settable doesn't need to be updated before ↵Kevin Van Brunt2019-02-201-2/+3
| | | | calling init()
* Fix Deprecation warnings for escape sequenceskotfu2018-12-061-5/+5
|
* Fix flake8 issuesTodd Leonhardt2018-12-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | This commit contains a very large number of trivial changes in order to fix flake8 errors and warnings. Predominantly these are whitespace changes. Additionally, the build for Python 3.7 on TravisCI has been tweaked to fail if there are any flake8 errors using the following commandline: * flake8 . --count --ignore=E252 --max-complexity=31 --max-line-length=127 --show-source --statistics NOTE: In the future the max cyclomatic complexity should be lowered, but some improvements need to be made first. One flake8 error is being ignored entirely: * E252 missing whitespace around parameter equals * ignored because it doesn't correctly deal with default argument values after a type hint A few flake8 errors are being selectively ignored in certain files: * C901 fuction is too complex * ignored in argparse_completer.py because the complex code is an override of argparse complexity * E302 expected 2 blank lines after ... * ignored in all unit test files for convenience * F401 module imported but unused * ignored in cmd2/__init__.py because imports are for convenience of cmd2 developers and backwards compatibility * F821 undefined name * ignored in cmd2 script files which are intended to run only within cmd2 applications via pyscript where "app" and "cmd" are defined
* Fixed transcript testing bug where last command in transcript has no ↵Todd Leonhardt2018-09-301-0/+1
| | | | | | | expected output Also: - Added unit test for this specific case
* Merged master into transcript_fixes branch and resolved conflictsTodd Leonhardt2018-09-301-7/+9
|\
| * Fixed several hack classes build to simulate file descriptorsTodd Leonhardt2018-09-231-7/+9
| | | | | | | | | | | | | | | | | | Now there is a single class, StdSim in utils.py, which is intended to simulate stdout and stderr file objects. This class replaced the following: - pyscript_bridge.py::CopyStream - transcript.py::OutputTrap - conftest.py::StdOut
* | Add transcript test for commands with no outputkotfu2018-09-141-1/+6
|/
* Fixed a couple potential crashes on opening filesTodd Leonhardt2018-06-061-0/+26
| | | | | | | | Fixed crashes that occur when attempting to open a file in a non-existent directory or a when the filename is too long. Specifically fixed this when redirecting output to a file and when saving a transcript based on the history. Also added a couple unit tests related to the fixes.
* Standardize cmd2 imports in tests and exampleskotfu2018-05-231-1/+1
|
* Defer import of unittestkotfu2018-05-061-1/+2
|
* Refactor transcript from history implementation and testkotfu2018-05-041-10/+8
|
* Fix transcript generate to close #385kotfu2018-05-041-0/+1
|
* Fix #384, multiline commands now appear properly in transcriptskotfu2018-05-031-2/+1
|
* Unit test for history transcript generationkotfu2018-05-031-108/+31
|
* Moved some argparse tests from test_transcript.py to test_argparse.pykotfu2018-05-031-31/+0
|
* Fix commented out transcript testskotfu2018-05-031-4/+3
|
* Merge branch 'test_merge' into test_ply_mergeEric Lin2018-05-021-3/+3
|\
| * Removed the expensive imports from cmd2/__init__.pyEric Lin2018-04-251-4/+4
| | | | | | | | | | | | | | Added some shared definitions to cmd2/__init__.py -> maybe there's a better place for these? Figured out how to trick bash into showing argument hints. It's a bit weird. Updated all of the tests and examples to import cmd2 resources from their new location without the automatic imports in cmd2/__init__.py For #369
* | multilineCommands -> multiline_commandskotfu2018-04-291-2/+2
| |
* | Remove POSIX_SHLEX and STRIP_QUOTES_FOR_NON_POSIXkotfu2018-04-251-5/+0
|/
* Cleaned up __init__.pyTodd Leonhardt2018-04-171-5/+5
| | | | | Removed things which were only needed for unit tests from __init__.py - Converted to importing from cmd2.cmd2.<foo> within the relevant unit tests