Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge branch 'develop' into feature/pep381-verification
Conflicts: pip/basecommand.py pip/download.py
- Loading branch information
Showing
with
169 additions
and 35 deletions.
- +1 −0 AUTHORS.txt
- +2 −0 docs/news.txt
- +12 −7 docs/requirements.txt
- +14 −3 docs/usage.txt
- +15 −10 pip/basecommand.py
- +7 −5 pip/commands/help.py
- +5 −5 pip/commands/search.py
- +2 −2 pip/download.py
- +5 −0 pip/status_codes.py
- +62 −0 tests/test_help.py
- +44 −3 tests/test_search.py
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| @@ -30,6 +30,7 @@ Oliver Tonnhofer | ||
| Olivier Girardot | ||
| Patrick Jenkins | ||
| Paul Nasrat | ||
| Paul Oswald | ||
| Peter Waller | ||
| Rene Dudfield | ||
| Ronny Pfannschmidt | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| @@ -0,0 +1,5 @@ | ||
| SUCCESS = 0 | ||
| ERROR = 1 | ||
| UNKNOWN_ERROR = 2 | ||
| VIRTUALENV_NOT_FOUND = 3 | ||
| NO_MATCHES_FOUND = 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| @@ -0,0 +1,62 @@ | ||
| from pip.exceptions import CommandError | ||
| from pip.commands.help import (HelpCommand, | ||
| SUCCESS, | ||
| ERROR,) | ||
| from mock import Mock | ||
| from nose.tools import assert_raises | ||
| from tests.test_pip import run_pip, reset_env | ||
|
|
||
|
|
||
| def test_run_method_should_return_sucess_when_finds_command_name(): | ||
| """ | ||
| Test HelpCommand.run for existing command | ||
| """ | ||
| options_mock = Mock() | ||
| args = ('freeze',) | ||
| help_cmd = HelpCommand() | ||
| status = help_cmd.run(options_mock, args) | ||
| assert status == SUCCESS | ||
|
|
||
| def test_run_method_should_return_sucess_when_command_name_not_specified(): | ||
| """ | ||
| Test HelpCommand.run when there are no args | ||
| """ | ||
| options_mock = Mock() | ||
| args = () | ||
| help_cmd = HelpCommand() | ||
| status = help_cmd.run(options_mock, args) | ||
| assert status == SUCCESS | ||
|
|
||
| def test_run_method_should_raise_command_error_when_command_does_not_exist(): | ||
| """ | ||
| Test HelpCommand.run for non-existing command | ||
| """ | ||
| options_mock = Mock() | ||
| args = ('mycommand',) | ||
| help_cmd = HelpCommand() | ||
| assert_raises(CommandError, help_cmd.run, options_mock, args) | ||
|
|
||
| def test_help_command_should_exit_status_ok_when_command_exists(): | ||
| """ | ||
| Test `help` command for existing command | ||
| """ | ||
| reset_env() | ||
| result = run_pip('help', 'freeze') | ||
| assert result.returncode == SUCCESS | ||
|
|
||
| def test_help_command_should_exit_status_ok_when_no_command_is_specified(): | ||
| """ | ||
| Test `help` command for no command | ||
| """ | ||
| reset_env() | ||
| result = run_pip('help') | ||
| assert result.returncode == SUCCESS | ||
|
|
||
| def test_help_command_should_exit_status_error_when_command_does_not_exist(): | ||
| """ | ||
| Test `help` command for non-existing command | ||
| """ | ||
| reset_env() | ||
| result = run_pip('help', 'mycommand', expect_error=True) | ||
| assert result.returncode == ERROR | ||
|
|
Oops, something went wrong.