wp1 icon indicating copy to clipboard operation
wp1 copied to clipboard

Clean up ImportError checks for wp1.credentials in production/test code

Open audiodude opened this issue 3 years ago • 0 comments

After #473, there should always be a credentials.py file. In previous iterations, the credentials.py file was deleted in order to run the nosetests.

Because of this, there is lots of code like this:

try:
  from wp1.credentials import ENV, CREDENTIALS
  S3_PUBLIC_URL = CREDENTIALS.get(ENV, {}).get('CLIENT_URL', {}).get(
      's3', 'http://credentials.not.found.fake')
except ImportError:
  S3_PUBLIC_URL = 'http://credentials.not.found.fake'

The point of this code is to provide default values and fallbacks when the credentials file can not be imported. We should clean these up, not only because it is ugly, but because the ImportError code is no longer used and hurts our test coverage.

audiodude avatar Aug 13 '22 17:08 audiodude