Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joshua Bonnett
committed
Jul 15, 2011
1 parent
f3b197f
commit 1b9a124
Showing
4 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,31 @@ | ||
import unittest | ||
from .id3proxy import Id3readerBackend | ||
|
||
class Id3ReaderTestCase(unittest.TestCase): | ||
audio_metadata = {'album': u'from the internet', | ||
'title': u'im chargin my laser', | ||
'artist': u'armstrong', | ||
'genre': u'Satire', | ||
'date': u'2011', | ||
'tracknumber': u'1'} | ||
backend=Id3readerBackend() | ||
def setUp(self): | ||
self.file = open('test_audio_files/test.mp3','rb+') | ||
|
||
def test_metadata(self): | ||
""" | ||
confirm that the extracted metadata matches the expected values | ||
""" | ||
metadata = self.backend.metadata(file=self.file) | ||
for fieldname, value in self.audio_metadata.items(): | ||
self.assertEqual( value, metadata[fieldname]) | ||
|
||
def test_filetype(self): | ||
""" | ||
confirm expected filetype | ||
""" | ||
filetype = self.backend.filetype(file=self.file) | ||
|
||
def runTest(self): | ||
self.test_metadata() | ||
self.test_filetype() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import unittest | ||
from fabric.decorators import task | ||
from fabric.decorators import * | ||
from armstrong.apps.audio.backends.id3reader.tests import Id3ReaderTestCase | ||
|
||
@task | ||
def test(): | ||
from armstrong.apps.audio.backends.id3reader.tests import * | ||
unittest.main() | ||
suite = unittest.TestLoader().loadTestsFromTestCase(Id3ReaderTestCase) | ||
unittest.TextTestRunner(verbosity=2).run(suite) |
Binary file not shown.