Updating tests for new storage config code

This commit is contained in:
Christopher Allan Webber 2011-08-21 15:14:45 -05:00
parent bd3b566dbe
commit 63c9a0c766
2 changed files with 16 additions and 15 deletions

View File

@ -1,7 +1,4 @@
[mediagoblin] [mediagoblin]
queuestore_base_dir = %(here)s/test_user_dev/media/queue
publicstore_base_dir = %(here)s/test_user_dev/media/public
publicstore_base_url = /mgoblin_media/
direct_remote_path = /mgoblin_static/ direct_remote_path = /mgoblin_static/
email_sender_address = "notice@mediagoblin.example.org" email_sender_address = "notice@mediagoblin.example.org"
email_debug_mode = true email_debug_mode = true
@ -15,5 +12,12 @@ tags_max_length = 50
# mediagoblin.init.celery.from_celery # mediagoblin.init.celery.from_celery
celery_setup_elsewhere = true celery_setup_elsewhere = true
[storage:publicstore]
base_dir = %(here)s/test_user_dev/media/public
base_url = /mgoblin_media/
[storage:queuestore]
queuestore_base_dir = %(here)s/test_user_dev/media/queue
[celery] [celery]
celery_always_eager = true celery_always_eager = true

View File

@ -60,23 +60,20 @@ class FakeRemoteStorage(storage.BasicFileStorage):
def test_storage_system_from_config(): def test_storage_system_from_config():
this_storage = storage.storage_system_from_config( this_storage = storage.storage_system_from_config(
{'somestorage_base_url': 'http://example.org/moodia/', {'base_url': 'http://example.org/moodia/',
'somestorage_base_dir': '/tmp/', 'base_dir': '/tmp/',
'somestorage_garbage_arg': 'garbage_arg', 'garbage_arg': 'garbage_arg',
'garbage_arg': 'trash'}, 'garbage_arg': 'trash'})
'somestorage')
assert this_storage.base_url == 'http://example.org/moodia/' assert this_storage.base_url == 'http://example.org/moodia/'
assert this_storage.base_dir == '/tmp/' assert this_storage.base_dir == '/tmp/'
assert this_storage.__class__ is storage.BasicFileStorage assert this_storage.__class__ is storage.BasicFileStorage
this_storage = storage.storage_system_from_config( this_storage = storage.storage_system_from_config(
{'somestorage_foobie': 'eiboof', {'foobie': 'eiboof',
'somestorage_blech': 'hcelb', 'blech': 'hcelb',
'somestorage_garbage_arg': 'garbage_arg', 'garbage_arg': 'garbage_arg',
'garbage_arg': 'trash', 'storage_class':
'somestorage_storage_class': 'mediagoblin.tests.test_storage:FakeStorageSystem'})
'mediagoblin.tests.test_storage:FakeStorageSystem'},
'somestorage')
assert this_storage.foobie == 'eiboof' assert this_storage.foobie == 'eiboof'
assert this_storage.blech == 'hcelb' assert this_storage.blech == 'hcelb'
assert this_storage.__class__ is FakeStorageSystem assert this_storage.__class__ is FakeStorageSystem