summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Removed pause commandTodd Leonhardt2017-07-034-24/+14
| | | | | | 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-023-6/+100
| | | | | | | | | | | 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 a bunch of unit testsTodd Leonhardt2017-07-022-13/+180
| | | | Also improved error handling in some exceptional cases.
* shell command now uses cmd.Cmd.stdout for outputTodd Leonhardt2017-07-021-3/+1
| | | | | | | | | The main advantages of this are that shell command output can now be - piped to another shell command - redirected to a file In the future, I may take it a step further where the output is piped, but using a pipe versus a real terminal changes the behavior of many shell commands, for example by getting rid of ANSI color and various other pretty formatting.
* Stopped skipping a unit test on Windows which should pass nowTodd Leonhardt2017-07-011-2/+0
|
* Added more unit tests for py and pyscript commandsTodd Leonhardt2017-07-013-0/+58
|
* Don't run an assert on Windows since it is failing on AppVeyorTodd Leonhardt2017-07-011-2/+6
| | | | It passes on my Windows 10 VM, but fails on AppVeyor. But manual testing reveals the feature is working.
* Attempt at fixing failing Windows unit testTodd Leonhardt2017-07-011-2/+8
| | | | Windows doesn't have an "ls" command by default ...
* Added some more tests for path completion and shell command completionTodd Leonhardt2017-07-012-30/+138
| | | | | | | Also: - Added a test for do_pause - Cleaned up a bunch of magic numbers from existing test for shell and path command completion
* Added more unit tests for the cmd2.Cmd.select() methodTodd Leonhardt2017-07-012-28/+136
| | | | | | | Also - Moved the existing tests for select to a more appropriate location - Minor tweak to working in README for readability
* Added some unit tests related to help and the help menuTodd Leonhardt2017-07-011-6/+57
| | | | | | | Also: - When running cmd2.py as main, enable use of IPython if present to aid with debugging and troubleshooting - Deleted a unit test which wasn't reliable
* Fix issue where pyperclip was printing line on startup when clipboard is emptyTodd Leonhardt2017-06-301-0/+2
| | | | Also skip unit test which passes when I run it on my systems, but fails on TravisCI and AppVeyor
* Attempt at fixing new unit test on Linux and WindowsTodd Leonhardt2017-06-301-1/+1
|
* Added a few unit testsTodd Leonhardt2017-06-301-1/+47
| | | | | - Added a couple unit tests related to cmd2.Cmd.default_to_shell - Added a unit test related to cmd2.Cmd._surround_ansi_escapes()
* Refactored clipboard code to make it a tiny bit simplerTodd Leonhardt2017-06-301-0/+31
| | | | Also added a few unit tests related to running an empty statement and dealing with precmd hook success and failure.
* Added code to set can_clip to False on Linux if can't copy/paste clipboardTodd Leonhardt2017-06-301-7/+4
| | | | | | | If Pyperclip could not find a copy/paste mechanism for your system, then cmd2.can_clip gets set to False. If cmd2.can_clip is False, then the "send_to_paste_buffer" test gets skipped.
* Added unit testsKevin Van Brunt2017-06-304-0/+39
|
* Fixed unit testsKevin Van Brunt2017-06-301-4/+14
|
* Bumped version to 0.7.4 and updated CHANGES fileTodd Leonhardt2017-06-291-1/+1
|
* Attempt to fix pipe_to unit test on Windows (for real this time)Todd Leonhardt2017-06-291-7/+4
| | | | The previous fix was apparently broken when I checked in with Linux line endings. This approach should be independent of that.
* Fix pipe_to unit test on Mac and WindowsTodd Leonhardt2017-06-291-1/+8
|
* Made output pipe to shell command featuer much more reliableTodd Leonhardt2017-06-291-7/+14
| | | | | | The ability to pipe the output of a cmd2 command to a shell command no longer depends on the presence of the "cat" shell command. It now directly pipes the contents of a file as the stdin to the shell command.
* Refactored to replace custom StubbornDict with collections.OrderedDictTodd Leonhardt2017-06-292-26/+7
| | | | The self.settable object is now an OrderedDict instead of a custom StubbornDict.
* Mac and Linux now have more similar subprocess.Popen interaction with CLI ↵Todd Leonhardt2017-06-291-9/+0
| | | | | | utiliites for pastebuffer/clipboard interaction Also removed a unit test which was now redundant since a newer one covered the same material in a better fashion.
* Improved unit test for writing to the pastebuffer/clipboardTodd Leonhardt2017-06-281-14/+7
| | | | | | It now uses cmd2.get_paste_buffer() to read the pastebuffer/clipboard instead of using Tkinter. It now also tests appending to the pastebuffer/clipboard in addition to writing to it.
* Multiple changesTodd Leonhardt2017-06-282-2/+2
| | | | | | | | - Disabled TravisCI macOS builds because they are heavily backlogged - Removed a file which should never have been committed - Updated Sphinx docs to relect that the default_file_name settable parameter no longer exists - Fixed comment in a unit test - Fixed a unit test to use os.path.sep for cross-platform compatibility
* Completely removed use of self.default_file_nameTodd Leonhardt2017-06-284-27/+19
| | | | | | | | 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.
* Simplified implementation of do__relative_loadTodd Leonhardt2017-06-284-8/+4
| | | | Also removed default argument for _relative_load and load
* Removed the ability for load command to load a script from a URLTodd Leonhardt2017-06-281-1/+1
| | | | From what I can tell, this hasn't worked in years and there aren't any unit tests which display how it is supposed to work.
* Skip the pastebuffer_read_and_write test if tools for interacting with ↵Todd Leonhardt2017-06-251-4/+3
| | | | clipboard/pastebuffer are not available
* Attempting to enable macOS builds on TravisCITodd Leonhardt2017-06-251-18/+19
|
* Skip PasteBuffer/Clipboard unit tests if appropriate CLI utilities are not ↵Todd Leonhardt2017-06-251-15/+17
| | | | available
* Various fixes and improvementsTodd Leonhardt2017-06-252-4/+26
| | | | | | - 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+
* Added pyscript unit test and attempt to fix a path completion test on WindowsTodd Leonhardt2017-06-242-1/+41
|
* Added some path completion unit testsTodd Leonhardt2017-06-241-1/+69
| | | | Also added some command completion unit tests for cases where there are no matches
* Set version to 0.7.4b for nowTodd Leonhardt2017-06-241-1/+1
|
* Fixed unit test for cmdenvironment and made it more robustTodd Leonhardt2017-06-161-8/+11
|
* Trying to fix shell command completion unit tests on Windows.Todd Leonhardt2017-06-151-10/+10
| | | | pyreadline won't engage the completer when just "!calc" is typed, need "! calc" or "shell calc". Basically it needs a space after to recognize it as a command and route it to the correct completer method.
* Added some tests for command completion, help completion, and shell command ↵Todd Leonhardt2017-06-151-0/+97
| | | | | | completion TODO: Still need to add a bunch of tests for path competion and more tests for all of the above mentioned completion cases.
* Updated CHANGES.md file and bumped version to 0.7.3Todd Leonhardt2017-06-141-1/+1
| | | | Bumped version in preparation for 0.7.3 release probably within the next couple weeks.
* Changed default value for USE_ARG_LIST global to TrueTodd Leonhardt2017-06-142-5/+6
| | | | | | | | | | | 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-133-6/+8
| | | | | | | | 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
|
* Added a unit test associated with the bug fixTodd Leonhardt2017-06-041-0/+11
|
* Updated cmdenvironment commandTodd Leonhardt2017-06-031-10/+6
| | | | | | | | It no longer displays settable parameters since this functionality was redundant since those are displayed with either set or show. It now shows additional global settings for parsing @options commands. In the future a few more things should probably be displayed here related to parameters which are not settable at runtime.
* Removed redundant list commandTodd Leonhardt2017-06-034-24/+37
| | | | | | | | 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-013-6/+8
| | | | | | | | 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.
* Moved _parsed into ParserManagerCatherine Devlin2017-05-301-1/+2
|
* Moved parser creation into ParserManagerCatherine Devlin2017-05-301-3/+6
|
* Bumping version to 0.7.3aTodd Leonhardt2017-05-221-1/+1
| | | | Changing to alpha version just to avoid confusion with release in PyPI