mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
tests: commands: cache: Add no-cache-dir test case
This commit is contained in:
parent
e212f66575
commit
8c28b8173a
1 changed files with 12 additions and 0 deletions
|
@ -216,3 +216,15 @@ def test_cache_purge_too_many_args(script, wheel_cache_files):
|
|||
# Make sure nothing was deleted.
|
||||
for filename in wheel_cache_files:
|
||||
assert os.path.exists(filename)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("command", ["info", "list", "remove", "purge"])
|
||||
def test_cache_abort_when_no_cache_dir(script, command):
|
||||
"""Running any pip cache command when cache is disabled should
|
||||
abort and log an informative error"""
|
||||
result = script.pip('cache', command, '--no-cache-dir',
|
||||
expect_error=True)
|
||||
assert result.stdout == ''
|
||||
|
||||
assert ('ERROR: pip cache commands can not function'
|
||||
' since cache is disabled.' in result.stderr.splitlines())
|
||||
|
|
Loading…
Reference in a new issue