SAAS-560: Deploy separate cloud storage config files for each development environment
Default to production config files if dev env specific files are not found. Fix analyzer unit tests.
This commit is contained in:
parent
e2ff452b8a
commit
cee0ff4881
4 changed files with 20 additions and 4 deletions
|
@ -5,6 +5,7 @@ import multiprocessing
|
|||
import Queue
|
||||
import datetime
|
||||
from airtime_analyzer.analyzer_pipeline import AnalyzerPipeline
|
||||
from airtime_analyzer import config_file
|
||||
|
||||
DEFAULT_AUDIO_FILE = u'tests/test_data/44100Hz-16bit-mono.mp3'
|
||||
DEFAULT_IMPORT_DEST = u'Test Artist/Test Album/44100Hz-16bit-mono.mp3'
|
||||
|
@ -20,10 +21,11 @@ def teardown():
|
|||
def test_basic():
|
||||
filename = os.path.basename(DEFAULT_AUDIO_FILE)
|
||||
q = multiprocessing.Queue()
|
||||
cloud_storage_enabled = False
|
||||
cloud_storage_config_path = '/etc/airtime-saas/production/cloud_storage.conf'
|
||||
cloud_storage_config = config_file.read_config_file(cloud_storage_config_path)
|
||||
file_prefix = u''
|
||||
#This actually imports the file into the "./Test Artist" directory.
|
||||
AnalyzerPipeline.run_analysis(q, DEFAULT_AUDIO_FILE, u'.', filename, file_prefix, cloud_storage_enabled)
|
||||
AnalyzerPipeline.run_analysis(q, DEFAULT_AUDIO_FILE, u'.', filename, file_prefix, cloud_storage_config)
|
||||
metadata = q.get()
|
||||
assert metadata['track_title'] == u'Test Title'
|
||||
assert metadata['artist_name'] == u'Test Artist'
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
from nose.tools import *
|
||||
from airtime_analyzer.cloud_storage_uploader import CloudStorageUploader
|
||||
from airtime_analyzer.airtime_analyzer import AirtimeAnalyzerServer
|
||||
from airtime_analyzer import config_file
|
||||
|
||||
def setup():
|
||||
pass
|
||||
|
@ -9,5 +10,7 @@ def teardown():
|
|||
pass
|
||||
|
||||
def test_analyze():
|
||||
cl = CloudStorageUploader()
|
||||
cloud_storage_config_path = '/etc/airtime-saas/production/cloud_storage.conf'
|
||||
cloud_storage_config = config_file.read_config_file(cloud_storage_config_path)
|
||||
cl = CloudStorageUploader(cloud_storage_config)
|
||||
cl._storage_backend = "file"
|
Loading…
Add table
Add a link
Reference in a new issue