summaryrefslogtreecommitdiff
path: root/tests/conftest.py
Commit message (Collapse)AuthorAgeFilesLines
* Added a with_category decorator that can be used to tag a command category.Eric Lin2018-04-111-1/+0
| | | | | | | | | Changed the detection of with_argparse decorated commands to be less hacky/brittle. Now it tags the function with help_summary. Fixed issue with handling commands that provide a custom help_ function. We can now redirect the output to a string to be formatted with the other commands. Added some documentation explaining the new help categories. Updated unit tests.
* Fixed issue where categorization is skipped when there's a help_<command> ↵Eric Lin2018-04-111-0/+18
| | | | | | | | function provided. In verbose help, added check for argparse usage block (starting with 'usage: '), to skip that block and move to the next comment block Added unit tests for new categorization code Updated example to demonstrate skipping of argparse usage statement
* Fixing unit testsKevin Van Brunt2018-03-161-1/+2
|
* Removed abbrev attributeKevin Van Brunt2018-03-021-3/+1
|
* History enhancementsTodd Leonhardt2018-01-201-3/+5
| | | | | | | | | | History changes: - Unknown commands are no longer saved in the history - history command now has a -t option to generate a transcript based on commands in the history Also: - Moved examples transcripts from examples to examples/transcripts - Added a new transcript for use with the pirate.py example
* Fixed unit testsTodd Leonhardt2018-01-201-1/+0
| | | | Updated unit tests due to changes in how help is output for commands decorated with an argparse ArgumentParser.
* Improved how new argparse-based decorators provide helpTodd Leonhardt2018-01-171-1/+1
| | | | | | Now "help command_name" and "command_name -h" provide exactly the same text. The function docstring for the "do_*" command sets and overrides the ArgumentParser "description" if the docstring is not empty.
* do_edit() no longer edits history, just files #252kotfu2018-01-161-2/+0
|
* Remove do_save() and do_run() for #252kotfu2018-01-161-1/+1
|
* Implement -o, -r, and -e options for issue #252Jared Crapo2018-01-151-3/+4
|
* cmdenvironment command has been removed and its functionality now exists as ↵Todd Leonhardt2018-01-151-2/+1
| | | | a -a/--all option to the set command
* show command has been removedTodd Leonhardt2018-01-151-1/+1
| | | | | | It's functionality has been moved inside the set command. The set command now uses an argparse parser.
* Fixed expected value of "help history" for unit testsTodd Leonhardt2018-01-151-9/+13
|
* __relative_load command is now hidden from help menu by defaultTodd Leonhardt2018-01-151-2/+2
|
* Fixed do_history unit tests and implementationTodd Leonhardt2018-01-151-9/+10
|
* feedback_to_output now defaults to FalseTodd Leonhardt2017-08-201-13/+13
| | | | 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 unit testKevin Van Brunt2017-07-191-1/+1
|
* Fixed a few bugs and examplesTodd Leonhardt2017-07-031-4/+2
| | | | | | | | | | | | | | 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-2/+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.
* Completely removed use of self.default_file_nameTodd Leonhardt2017-06-281-16/+15
| | | | | | | | Load and relative load now require a file path Edit will use a temporary file by default and delete it when done Save will use a temporary file by default and inform the user what it is Also changed the default value for autorun_on_edit to False so that it can safely be used as an actual file editor.
* Added new pyscript commandTodd Leonhardt2017-06-131-2/+2
| | | | | | | | 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
* Removed redundant list commandTodd Leonhardt2017-06-031-3/+4
| | | | | | | | 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/+2
| | | | | | | | 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-2/+2
| | | | | | 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.
* Mostly fix a bunch of spelling mistakes.Todd Leonhardt2017-03-131-6/+7
| | | | A few other miscellaneous minor tweaks for whitespace and such.
* Refactored to move all cmd2.Cmd class member variables to beginning.Todd Leonhardt2017-02-111-1/+3
| | | | | | | | Also: - Added locals_in_py to settable parameters to match documentation. - Added pycon2010 slides back into doc build since they are referenced with :doc: - Fixed some references in the documentation - Updated unit tests accordingly
* Various parsing fixes and improvements:TL2017-02-071-0/+2
| | | | | | | | 1) Built-in commands which use @options now properly deal with the USE_ARG_LIST boolean flag 2) Added an "autorun_on_edit" settable parameter which defaults to True to preserve backwards compatibility, but can be set False to prevent automatically running files as scripts when the editor closes 3) Improved how piping works so it can deal with commands which output a large amount of data
* 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
* Fixed long-form show unit test to deal with Windows not having colors.Todd Leonhardt2017-02-041-3/+6
|
* Added unit test for "show -l".Todd Leonhardt2017-02-041-0/+16
|
* Added more and better unit tests for load and save commandsTodd Leonhardt2017-02-041-4/+64
|
* First stage of refactoring to support full simultaneous Python 2 and 3 ↵Todd Leonhardt2016-12-091-0/+1
| | | | compatibility via use of the six module.
* Add unit testsFederico Ceratto2016-02-231-0/+45