Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring the test bucket name #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions baiji/pod/test_asset_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from baiji import s3


TEST_BUCKET = os.getenv('BAIJI_POD_TEST_BUCKET', 'baiji-pod-test')

class CreateDefaultAssetCacheMixin(object):
def setUp(self):
from baiji.pod import AssetCache
Expand All @@ -26,7 +28,7 @@ def setUp(self):
# existing first.
os.rmdir(self.cache_dir)

self.bucket = 'baiji-pod-test'
self.bucket = TEST_BUCKET

config = Config()
config.CACHE_DIR = self.cache_dir
Expand All @@ -46,9 +48,9 @@ def test_exceptions_interchangable_with_s3(self):
from baiji.pod import AssetCache

with self.assertRaises(s3.KeyNotFound):
self.cache('s3://baiji-pod-test/there/is/nothing/here/without.a.doubt')
self.cache('s3://{}/there/is/nothing/here/without.a.doubt'.format(TEST_BUCKET))
with self.assertRaises(AssetCache.KeyNotFound):
self.cache('s3://baiji-pod-test/there/is/nothing/here/without.a.doubt')
self.cache('s3://{}/there/is/nothing/here/without.a.doubt'.format(TEST_BUCKET))


class TestMissingAssets(CreateTestAssetCacheMixin, unittest.TestCase):
Expand Down