summaryrefslogtreecommitdiff
path: root/tests/test_completion.py
Commit message (Collapse)AuthorAgeFilesLines
* Added unit test for path completion in root directoryKevin Van Brunt2019-04-051-0/+19
|
* Made run_cmd return out and errKevin Van Brunt2019-03-201-1/+1
|
* Aliases are now stored within the StatementParser instanceTodd Leonhardt2019-03-161-1/+1
| | | | | | | Also: - Added read-only aliases property to cmd2.Cmd to get aliases from the StatementParser - Added a setter for the allow_redirection property in cmd2.Cmd - Made some initialization code more self-documenting
* First stage of attribute refactoringTodd Leonhardt2019-03-131-3/+3
| | | | | | | | | | 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 unit test for matches_sort_keyKevin Van Brunt2019-02-271-1/+27
|
* 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
* Added more code coverage of shell_cmd_completeKevin Van Brunt2018-10-261-0/+15
|
* Added more coverage for path_completeKevin Van Brunt2018-10-261-3/+24
|
* Refactored filtering in path_complete to use a functionKevin Van Brunt2018-10-261-1/+1
|
* Added code to handle -- in argparse completerKevin Van Brunt2018-10-101-25/+0
|
* Increasing code coverageKevin Van Brunt2018-10-091-0/+24
|
* Using sub-command instead of subcommand where possible to be consistent with ↵Kevin Van Brunt2018-10-051-18/+18
| | | | argparse
* Added more code coverage with unit testsKevin Van Brunt2018-09-281-0/+17
|
* Added more code coverageKevin Van Brunt2018-09-281-0/+9
|
* Merge branch 'macro' into argparse_conversionKevin Van Brunt2018-09-281-4/+4
|\
| * Addressing code review commentsKevin Van Brunt2018-09-281-4/+4
| |
* | Merge branch 'macro' into argparse_conversionKevin Van Brunt2018-09-271-1/+18
|\ \ | |/
| * Made _func_named() more reliableKevin Van Brunt2018-09-271-1/+18
| | | | | | | | Added unit tests
* | Ported shell to argparseKevin Van Brunt2018-09-271-5/+14
| |
* | Fixed unit tests for help completionKevin Van Brunt2018-09-261-13/+32
| |
* | Converted help to argparseKevin Van Brunt2018-09-261-1/+1
|/
* Fixed several hack classes build to simulate file descriptorsTodd Leonhardt2018-09-231-11/+3
| | | | | | | | | 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
* Updated docs and unit testsKevin Van Brunt2018-08-021-1/+1
|
* Added alphabetical_sort() functionKevin Van Brunt2018-08-011-1/+1
|
* Added matches_sorted member to support custom sorting order of ↵Kevin Van Brunt2018-08-011-3/+3
| | | | | | | tab-completion matches Made all sorting alphabetical Fixed case where extra slash was printing when tab completing users on Windows
* Merge branch 'master' into speedup_importkotfu2018-05-231-123/+1
|\ | | | | | | | | | | | | # Conflicts: # cmd2/cmd2.py # tests/test_completion.py # tests/test_submenu.py
| * Extract submenu code to new projectkotfu2018-05-091-121/+0
| |
* | Extract AddSubmenu() into it’s own modulekotfu2018-05-061-2/+3
|/
* Rename some test functions to fix #388kotfu2018-05-051-6/+6
|
* Merge branch 'test_merge' into test_ply_mergeEric Lin2018-05-021-1/+1
|\
| * Merge remote-tracking branch 'origin/master' into bash_completionEric Lin2018-04-271-5/+6
| |\ | | | | | | | | | Updated argcomplete_bridge to use new constants/utils.
| * | Removed the expensive imports from cmd2/__init__.pyEric Lin2018-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | 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
* | | Merge branch 'ply' of github.com:python-cmd2/cmd2 into plykotfu2018-04-261-5/+6
|\ \ \ | | |/ | |/|
| * | No longer running test_path_completion_complete_user unit test on WindowsKevin Van Brunt2018-04-261-5/+6
| |/
* | First stage of refactoring cmd2.parseline() for tab completionkotfu2018-04-261-38/+0
|/
* Switched the default behavior in cmd2 for argparse commands to use the ↵Eric Lin2018-04-211-80/+9
| | | | AutoCompleter by default.
* Addresses comments on #362Eric Lin2018-04-191-14/+9
|
* Adjusted some coverage configuration. Found and fixed bug in help completion.Eric Lin2018-04-181-49/+181
|
* Removed unit test dependency on mockTodd Leonhardt2018-04-151-1/+1
| | | | | mock was a backport of Python's built in unittest.mock and was required for Python 3.2 or earlier - Since we now support Python 3.4+ moving forward we no longer need to make use of the 3rd party mock module
* Renamed variable to match what its called in cmd2.pyKevin Van Brunt2018-04-151-6/+6
|
* Updated comments and examplesKevin Van Brunt2018-04-151-1/+1
|
* More unit tests and commentsKevin Van Brunt2018-04-151-3/+18
|
* More opening quote unit testsKevin Van Brunt2018-04-151-3/+63
|
* Unit tests for adding opening quoteKevin Van Brunt2018-04-151-18/+68
|
* Simplifying adding opening quotesKevin Van Brunt2018-04-131-4/+1
|
* Trying to fix Windows unit test when running on AppVeyorKevin Van Brunt2018-04-131-3/+3
|
* Added some basic user completion on WindowsKevin Van Brunt2018-04-131-6/+2
|
* Allowing the use of ~user expansion in pathsKevin Van Brunt2018-04-121-14/+12
|
* Added alias parse_line unit testKevin Van Brunt2018-04-021-0/+10
|
* Removed unnecessary sorting and duplicate removal from the completers since allKevin Van Brunt2018-03-311-10/+18
| | | | | | results from these functions are returned to complete() which already does these things. These changes also provide better examples of what is required to write a completer and what isn't.