diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2014-02-14 23:14:54 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2014-02-14 23:14:54 (GMT) |
commit | c00fa6387d9a2ceb3b4c4fa94646279c8b70fb4f (patch) | |
tree | f12c28e8ab319b2180c41a3f792ac93d73622495 /Lib/test/test_ensurepip.py | |
parent | e84fde981dd957f53ec81e2d6f14a7cf418a9925 (diff) | |
download | cpython-c00fa6387d9a2ceb3b4c4fa94646279c8b70fb4f.zip cpython-c00fa6387d9a2ceb3b4c4fa94646279c8b70fb4f.tar.gz cpython-c00fa6387d9a2ceb3b4c4fa94646279c8b70fb4f.tar.bz2 |
Issue #19744: Handle missing SSL/TLS in ensurepip
- now also allows POSIX installation with SSL/TLS missing
- a goal for pip 1.6 is to allow local use without SSL/TLS
Diffstat (limited to 'Lib/test/test_ensurepip.py')
-rw-r--r-- | Lib/test/test_ensurepip.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_ensurepip.py b/Lib/test/test_ensurepip.py index 6ddf8f6..8644a65 100644 --- a/Lib/test/test_ensurepip.py +++ b/Lib/test/test_ensurepip.py @@ -281,12 +281,20 @@ class TestMissingSSL(EnsurepipMixin, unittest.TestCase): self.run_pip.assert_not_called() self.assertIn("PIP_THIS_SHOULD_STAY", self.os_environ) + def test_main_exits_early_with_warning(self): + with test.support.captured_stderr() as stderr: + ensurepip_no_ssl._main(["--version"]) + warning = stderr.getvalue().strip() + self.assertTrue(warning.endswith("requires SSL/TLS"), warning) + self.run_pip.assert_not_called() + # Basic testing of the main functions and their argument parsing EXPECTED_VERSION_OUTPUT = "pip " + ensurepip._PIP_VERSION class TestBootstrappingMainFunction(EnsurepipMixin, unittest.TestCase): + @requires_usable_pip def test_bootstrap_version(self): with test.support.captured_stdout() as stdout: with self.assertRaises(SystemExit): |