CC-5709: Airtime Analyzer
* Added MetadataAnalyzer unit tests and test data * Improved debug logging and squashed pika logging * Implemented file moving * Extract the track number/total * Fixed mapping of mutagen to Airtime fields in a few spots. The mapping matches the DB column names now. * Fixed the bin/airtime_analyzer binary * Started work on PluploadController to make it work with the new File API
This commit is contained in:
parent
c0818682af
commit
6d7117f670
20 changed files with 194 additions and 11 deletions
|
@ -0,0 +1,24 @@
|
|||
from nose.tools import *
|
||||
import multiprocessing
|
||||
from airtime_analyzer.analyzer_pipeline import AnalyzerPipeline
|
||||
|
||||
DEFAULT_AUDIO_FILE = u'tests/test_data/44100Hz-16bit-mono.mp3'
|
||||
|
||||
def setup():
|
||||
pass
|
||||
|
||||
def teardown():
|
||||
pass
|
||||
|
||||
def test_basic():
|
||||
q = multiprocessing.Queue()
|
||||
AnalyzerPipeline.run_analysis(q, DEFAULT_AUDIO_FILE, u'.')
|
||||
results = q.get()
|
||||
assert results['track_title'] == u'Test Title'
|
||||
assert results['artist_name'] == u'Test Artist'
|
||||
assert results['album_title'] == u'Test Album'
|
||||
assert results['year'] == u'1999'
|
||||
assert results['genre'] == u'Test Genre'
|
||||
assert results['mime_type'] == 'audio/mpeg' # Not unicode because MIMEs aren't.
|
||||
assert results['length_seconds'] == 3.90925
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue