summaryrefslogtreecommitdiff
path: root/tests/test_parsing.py
Commit message (Collapse)AuthorAgeFilesLines
* Add in isort changesTodd Leonhardt2021-01-311-2/+6
|
* Attempt to fix remaining black failuresTodd Leonhardt2021-01-311-10/+80
|
* Add black for automatic code formatTodd Leonhardt2021-01-311-140/+123
|
* Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-221-2/+9
| | | | minor import changes.
* Minor formatting changes. Fixed some inaccurate commentsEric Lin2020-08-201-19/+72
|
* Updated documentation with more explicit discussions on testingEric Lin2020-08-201-1/+14
| | | | Added unit test to verify command name validation updates.
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-241-0/+1
| | | | | | | 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
* Added Cmd2ShlexErrorKevin Van Brunt2020-03-121-2/+2
|
* Moved custom cmd2 exceptions to a separate file and removed them from public APITodd Leonhardt2020-02-181-3/+3
|
* Removed ability for aliases and macros to share names with commandsKevin Van Brunt2019-08-051-8/+0
|
* Fixed inconsistent parsing/tab completion behavior based on the value of ↵Kevin Van Brunt2019-08-021-1/+0
| | | | | | `allow_redirection`. This flag is only meant to be a security setting that prevents redirection of stdout and should not alter parsing logic.
* Moved the sorting of shortcuts into StatementParser which allows users to ↵Kevin Van Brunt2019-07-161-1/+1
| | | | pass in a dictionary instead of a tuple for shortcuts.
* Fixed unit testsKevin Van Brunt2019-06-151-3/+3
|
* Merge branch 'master' into history_fixesKevin Van Brunt2019-06-141-3/+0
|\
| * Removed copyright headers from source files and updated LICENSE with current ↵Kevin Van Brunt2019-06-071-3/+0
| | | | | | | | year
* | Fix history display issuesTodd Leonhardt2019-06-131-0/+12
|/ | | | | | | | | | | Issues were two fold: - HistoryItem statement.raw was getting mangled for multiline commands due to macro-related changes in _input_line_to_statement() - HistoryItem pretty printing wasn't using rstrip() anymore in verbose mode I added a couple unit tests in the process of getting here. But we should add some explicit unit tests of _input_line_to_statement() for cases like: - basic single-line command - macro single-line command - multiline command
* Added unit testsKevin Van Brunt2019-05-131-0/+28
|
* Added unit testsKevin Van Brunt2019-05-131-1/+99
|
* Added capability to redirect pipe commands and chain them togetherKevin Van Brunt2019-05-071-17/+16
|
* Fixed issue where the wrong terminator was being appended by ↵Kevin Van Brunt2019-05-061-1/+0
| | | | Statement.expanded_command_line()
* Made unit test more correctKevin Van Brunt2019-03-171-4/+5
|
* Added unit tests for expand flag of parse()Kevin Van Brunt2019-03-171-0/+7
|
* Merged master into history and resolved conflictsTodd Leonhardt2019-03-041-76/+19
|\
| * Removed support for c-style and embedded commentsKevin Van Brunt2019-03-011-75/+19
| |
* | Fixed a couple bugs and added unit testsTodd Leonhardt2019-03-031-1/+8
|/
* 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 unit test for valid case of calling is_valid_command()Todd Leonhardt2018-10-031-6/+12
|
* Added unit test for is_valid_commandKevin Van Brunt2018-10-031-0/+26
|
* Fixed bug in handling unicode digits in macro argumentsKevin Van Brunt2018-09-271-0/+8
|
* Added unit tests for MacroArg regular expressionsKevin Van Brunt2018-09-271-0/+93
|
* Fix bug in `parse_command_only`kotfu2018-09-091-33/+76
| | | | More robust unit tests identified a bug, which is also fixed in this commit.
* Took a stab at improving documentation and unit tests for ↵Todd Leonhardt2018-09-081-10/+50
| | | | | | Statement.parse_command_only() Also slightly improved a few other unit tests
* Use attrs on Statement object to do immutabilityTodd Leonhardt2018-09-061-1/+15
|
* Add back previously removed tests for statement.argskotfu2018-09-051-2/+45
|
* Using empty strings and lists instead of None for default values in StatmentKevin Van Brunt2018-09-011-27/+30
|
* Removed Statement.args since it was redundant. Replaced with already parsed ↵Kevin Van Brunt2018-08-231-98/+83
| | | | list of args with quotes preserved.
* parse_command_only now appropriately sets multiline_commandkotfu2018-08-081-0/+10
|
* Add unit tests to validate embedded newline parsingkotfu2018-08-061-1/+18
|
* Merged master with bug fix for #474Todd Leonhardt2018-07-171-5/+18
|\
| * Bug fix and unit tests for #474kotfu2018-07-161-4/+18
| |
* | Add tests for StatementParser() created with no arguments.kotfu2018-07-151-0/+26
| |
* | More assertions to check for string value of statementkotfu2018-06-031-16/+79
|/
* Standardize cmd2 imports in tests and exampleskotfu2018-05-231-2/+1
|
* Fix bug in sequential terminator logickotfu2018-05-171-2/+2
|
* Add unit tests to check for multiple terminatorskotfu2018-05-161-2/+36
|
* Remove cmd2.Cmd.redirector for #381kotfu2018-05-101-8/+9
|
* Make alias checking and command parsing use the same regexkotfu2018-05-071-0/+24
| | | | | | | | Provide a new is_valid_command() method on StatementParser to determine whether a string of characters could be a valid command. That means it can’t include any redirection, quote chars, whitespace, or terminator characters. This method is used when someone tries to create an alias, to ensure when we try and parse the alias that it will actually parse. This nicely encapsulates and standardizes all the logic for parsing and expansion into the StatementParser class. Also fix a bug in the regex to match valid command names, and add a bunch of new unit tests to ensure the bug stays fixed.
* Add unit tests to ensure multiple terminator chars workskotfu2018-05-061-16/+26
|
* Rename unit testkotfu2018-05-061-1/+1
|
* Add more unit testskotfu2018-05-061-5/+14
|