MCPcopy Index your code
hub / github.com/python/cpython / test_selected_wheel_path_with_dir

Method test_selected_wheel_path_with_dir

Lib/test/test_ensurepip.py:55–68  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

53 self.assertEqual(pip_filename, bundled_wheel_path.name)
54
55 def test_selected_wheel_path_with_dir(self):
56 # Test _get_pip_whl_path_ctx() with a wheel package directory
57 pip_filename = "pip-20.2.2-py2.py3-none-any.whl"
58
59 with tempfile.TemporaryDirectory() as tmpdir:
60 self.touch(tmpdir, pip_filename)
61 # not used, make sure that they're ignored
62 self.touch(tmpdir, "pip-1.2.3-py2.py3-none-any.whl")
63 self.touch(tmpdir, "wheel-0.34.2-py2.py3-none-any.whl")
64 self.touch(tmpdir, "pip-script.py")
65
66 with unittest.mock.patch.object(ensurepip, '_WHEEL_PKG_DIR', Path(tmpdir)):
67 with ensurepip._get_pip_whl_path_ctx() as bundled_wheel_path:
68 self.assertEqual(pip_filename, bundled_wheel_path.name)
69
70
71class EnsurepipMixin:

Callers

nothing calls this directly

Calls 3

touchMethod · 0.95
PathClass · 0.90
assertEqualMethod · 0.45

Tested by

no test coverage detected