sintonia/python_apps/airtime_analyzer/tests/analyzer_pipeline_tests.py
Albert Santoni 6d7117f670 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
2014-03-10 16:32:23 -04:00

24 lines
732 B
Python

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