summaryrefslogtreecommitdiff
path: root/tests/test_transcript.py
Commit message (Collapse)AuthorAgeFilesLines
...
* Removed abbrev attributeKevin Van Brunt2018-03-021-2/+1
|
* Remove do_save() and do_run() for #252kotfu2018-01-161-3/+3
|
* cmdenvironment command has been removed and its functionality now exists as ↵Todd Leonhardt2018-01-151-2/+2
| | | | a -a/--all option to the set command
* show command has been removedTodd Leonhardt2018-01-151-2/+2
| | | | | | It's functionality has been moved inside the set command. The set command now uses an argparse parser.
* __relative_load command is now hidden from help menu by defaultTodd Leonhardt2018-01-151-6/+2
|
* Made a couple cleanup changesTodd Leonhardt2018-01-151-3/+4
| | | | | | | | | 1) cmd2 no longer imports make_option from optparse - test files and examples now import this directly - this helps emphasize that this old optparse methodology of adding options to commands is deprecated 2) All argparsers have been given custom names instead of just "argparser" - this helps with readability and maintainability, especially with IDE renaming and such
* Fix test_transcript.py in python 3.7kotfu2018-01-061-12/+17
| | | | re.escape() changed behavior in python 3.7.
* Fix a bug if there is only one slashJared Crapo2017-08-221-3/+7
|
* Add comments to all regex test filesJared Crapo2017-08-221-1/+0
|
* Updates to CmdLineApp()Jared Crapo2017-08-211-5/+5
|
* regex implementation complete. Still a few bugs.Jared Crapo2017-08-211-12/+38
|
* Checkpoint. Many tests working, multiline seems brokenJared Crapo2017-08-211-4/+9
|
* Simple but working version of new regex transcriptJared Crapo2017-08-211-1/+21
| | | | Escapes of slashes don’t work yet.
* Add lots more transcript testsJared Crapo2017-08-201-2/+12
|
* parametrize transcript testsJared Crapo2017-08-201-56/+8
|
* rename transcript filesJared Crapo2017-08-201-4/+4
|
* Move transcripts into their own directoryJared Crapo2017-08-201-3/+3
|
* feedback_to_output now defaults to FalseTodd Leonhardt2017-08-201-1/+1
| | | | This is so that non-essential info which isn't directly associated with command output, such as time elapsed while executing a command, won't redirect when command output is redirected using >, >>, or |.
* Fixed a few bugs and examplesTodd Leonhardt2017-07-031-0/+1
| | | | | | | | | | | | | | Bug fixes: - case_insensitive is no longer a runtime-settable parameter, but it was still listed as such - Fixed a recursive loop bug when abbreviated commands are enabled and it could get stuck in the editor forever - Added additional command abbreviations to the "exclude from history" list - Fixed argparse_example.py and pirate.py examples Other changes: - Organized all attributes used to configure the ParserManager into a single location - Set the default value of "abbrev" to False (which controls whether or not abbreviated commands are allowed) - With good tab-completion of command names, using abbreviated commands isn't a particularly useful feature - And it can create problems
* Removed pause commandTodd Leonhardt2017-07-031-3/+2
| | | | | | It was pretty useless, it just printed a message and sat there and waited for the user to hit enter. It didn't feel like it belonged in a top-level framework. If a particular application wants this functionality, it is a 2 line change to add it back.
* Fixed bugs, removed dead code, and added unit testsTodd Leonhardt2017-07-021-1/+2
| | | | | | | | | | | Fixed a bug where CmdResult named tuple Truthiness wasn't working in Python 2 Removed unused cmd2.History.search() method. Added unit tests for: - History class - cast() function - CmdResult namedtuple
* Added more unit tests for the cmd2.Cmd.select() methodTodd Leonhardt2017-07-011-28/+0
| | | | | | | Also - Moved the existing tests for select to a more appropriate location - Minor tweak to working in README for readability
* Refactored to replace custom StubbornDict with collections.OrderedDictTodd Leonhardt2017-06-291-5/+7
| | | | The self.settable object is now an OrderedDict instead of a custom StubbornDict.
* Various fixes and improvementsTodd Leonhardt2017-06-251-3/+6
| | | | | | - Removed some dead code in cmd2.py which was never used - Added a number of unit tests - Fixed how get_paste_buffer() and write_paste_buffer() work on macOS so that they work correctly on both Python 2.7 and Python 3.3+
* Changed default value for USE_ARG_LIST global to TrueTodd Leonhardt2017-06-141-1/+2
| | | | | | | | | | | Now by default all @options commands get passed a list of argument strings instead of a single argument string. This is a much easier and more robust behavior to deal with. Additionally, command-line arguments are intelligently separated based on location of quotes to group things into a single argument. WARNING: This change breaks backward compatibility for older applicaitons based on cmd2. To change the behavior to the way it used to be, add the following code to the __init__() method of our class derived from cmd2.Cmd: cmd2.set_use_arg_list(False) This change really does make it easier for developers new to using cmd2 however. It is to the point where I create all custom commands with @options, even if I use an empty list for the options because the argument parsing is just much better this way.
* Added new pyscript commandTodd Leonhardt2017-06-131-2/+3
| | | | | | | | This command is explicitly for running Python script files within an embedded Python interpreter. The advantages over the py command with "run" are: - Tab-completion of file system paths is supported - Command-line arguments can be passed to the Python script
* Fixes a bug which caused transcript failures to display twiceTodd Leonhardt2017-06-131-3/+3
|
* Removed redundant list commandTodd Leonhardt2017-06-031-3/+2
| | | | | | | | The extra functionality of listing a span (slice) of history items present in the list command has been incorporated into the existing history command and the list command has been removed. Unit tests have been updated accordingly. In the process a bug was fixed that was causing a crash if and end was supplied to the span but not a start.
* Added "exclude_from_help" list as a cmd2.Cmd public attributeTodd Leonhardt2017-06-011-2/+3
| | | | | | | | Added a list of commands to explicitly exclude displaying in the help menu of commands which detailed help can be retrieved for. By default, only "do_eof" is in this list since that isn't a command which is ever intended for an end user to directly enter on the command line. Also updated unit tests to reflect new default help menu.
* Fixed transcript testing issuesTodd Leonhardt2017-04-261-0/+1
| | | | | | Transcript testing no longer creates an unnecessary 2nd instance of the class derived from cmd2.Cmd. This dramatically simplifies transcript testing for derived classes which have required parameters during construction. As a side effect the, feedback_to_output attribute now defaults to false. This had some minor ripple effects on various unit tests.
* Added example of using a regular expression in a transcript test.Todd Leonhardt2017-03-161-0/+26
| | | | Also added a unit test for this feature.
* Mostly fix a bunch of spelling mistakes.Todd Leonhardt2017-03-131-0/+1
| | | | A few other miscellaneous minor tweaks for whitespace and such.
* Fixed a typo and added a unit test.Todd Leonhardt2017-02-101-0/+7
|
* Experiment with different modes of parsing command-line arguments for option ↵Todd Leonhardt2017-02-061-1/+1
| | | | | | | | commands. This is an experiment with usin non-POSIX parsing of the command line with shlex before passing it to the optparse OptionParser. The posix vs non-posix setitng primarily effects how quotes and escape characters are dealt with. I'm experimenting with various options to see what may feel the most natural for the majority of end users.
* Documented undocumented commands and removed command aliases.Todd Leonhardt2017-02-051-7/+2
| | | | | | | | The out-of-the-box help menu now looks a lot cleaner: - All redundant command aliases have been removed (NOTE: They can still be used if self.abbrev is True, which is the default) - All previously undocumented commands have been documented - Unit tests and README.rst documentation has been updated to reflect new behavior
* Use older form of invoking super class ctor for Py2/3 compatibility.Todd Leonhardt2017-02-051-1/+2
|
* Fixed flaw in unit tests so they can be reliably parallelized.Todd Leonhardt2017-02-051-9/+6
| | | | | | | | Fixed a bug which made parallelizing the unit tests with pytest-xdist unreliable. The unit tests can now be run in parallel using pytest-xdist for a dramatic speedup on multicore machines. To do this use: py.test -n4 (where 4 is the number of cores you wish to parallelize across)
* Added a couple more unit tests.Todd Leonhardt2017-02-051-0/+26
| | | | | One for transcript testing with multi-line commands and commments at the beginning. Another for cmdloop testing with use_rawinput = False
* Added unit test for doing transcript testing within the cmdloop.Todd Leonhardt2017-02-051-2/+31
|
* Added unit test for the interactive form of do_py().Todd Leonhardt2017-02-051-1/+1
|
* Fixed how the six.moves.input function is imported and used.Todd Leonhardt2017-02-051-2/+31
| | | | Also added a unit test for the cmd2.Cmd.select() method.
* Added unit test for passing command line arguments at invocationTodd Leonhardt2017-02-041-0/+12
|
* Added more and better unit tests for load and save commandsTodd Leonhardt2017-02-041-10/+11
|
* Added another unit test and a test fixture associated with it.Todd Leonhardt2017-02-031-2/+25
| | | | This was specifically for testing parsing of options with quotes provided to support embedded spaces
* Fixed optparse parsing of arguments so it works correctly both with embedded ↵Todd Leonhardt2017-02-031-1/+7
| | | | quotes and mid-line options.
* Fixed a couple unit tests which were failing on Python 2.7Todd Leonhardt2017-01-301-2/+3
|
* Added unit test of comment-stripping functionalityTodd Leonhardt2017-01-291-3/+12
|
* Added a couple simple unit tests for optparser functionalityTodd Leonhardt2017-01-291-0/+33
|
* Added a 2nd way of unit testing transcript tests which covers some ↵Todd Leonhardt2017-01-291-6/+12
| | | | additional code.
* Fix the unit test for testing a transcriptTodd Leonhardt2017-01-231-34/+2
|