Skip to content

Commit

Permalink
Only test read only status of S3 cache backend when applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed May 3, 2015
1 parent 3a6e9dd commit 7450026
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions pip_accel/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,14 @@ def test_s3_backend(self):
# Install the verboselogs package using the S3 cache backend.
num_installed = accelerator.install_from_arguments(pip_install_args)
assert num_installed == 1, "Expected pip-accel to install exactly one package!"
# Check the state of the S3 cache backend.
if i < 3:
assert not accelerator.config.s3_cache_readonly, "S3 cache backend is unexpectedly in read only state!"
else:
assert accelerator.config.s3_cache_readonly, "S3 cache backend is unexpectedly not in read only state!"
# Check the state of the S3 cache backend? This test is only valid
# if the S3 backend is active (this is why we first check the
# $PIP_ACCEL_S3_BUCKET environment variable).
if os.environ.get('PIP_ACCEL_S3_BUCKET'):
if i < 3:
assert not accelerator.config.s3_cache_readonly, "S3 cache backend is unexpectedly in read only state!"
else:
assert accelerator.config.s3_cache_readonly, "S3 cache backend is unexpectedly not in read only state!"

def test_wheel_install(self):
"""
Expand Down

0 comments on commit 7450026

Please sign in to comment.