Misc. style tweaks to S3Cache changes and tests

This commit is contained in:
Benjamin Yolken 2017-02-03 15:43:43 -08:00
parent 1546b1ae71
commit 00b6b0ac68
2 changed files with 3 additions and 1 deletions

View File

@ -35,6 +35,7 @@ class S3Cache(BaseCache):
self.default_timeout = default_timeout
self.s3_client = boto3.client('s3')
self.bucket = config.get('S3_CACHE_BUCKET')
self.key_prefix = config.get('S3_CACHE_KEY_PREFIX')

View File

@ -1,4 +1,5 @@
import cPickle
import mock
from superset import app, results_backends
@ -44,7 +45,7 @@ class ResultsBackendsTests(SupersetTestCase):
self.assertEquals(call_args[1], 'test-bucket')
self.assertEquals(call_args[2], 'test-prefix/test-key')
def test_s3_cache_exception(self):
def test_s3_cache_set_exception(self):
self.mock_s3_client.upload_fileobj.side_effect = Exception('Something bad happened!')
result = self.s3_cache.set('test-key', 'test-value')