-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_predecode.py
26 lines (22 loc) · 1021 Bytes
/
test_predecode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import predecode
import unittest
class PredecoderTests(unittest.TestCase):
def setUp(self):
tr_log = None
location = None
self.predecoder = predecode.Predecoder(tr_log, location)
def test_target_filename(self):
self.assertEquals('filename.wav',
self.predecoder._target_filename('filename.mp3'))
self.assertEquals('filename.wav',
self.predecoder._target_filename('filename.flac'))
def test_extension(self):
self.assertEquals('mp3',
self.predecoder._extension('filename.mp3'))
self.assertEquals('mp3',
self.predecoder._extension('filename.MP3'))
def test_decodable(self):
self.assertTrue(self.predecoder._decodable('filename.mp3'))
self.assertTrue(self.predecoder._decodable('filename.flac'))
self.assertFalse(self.predecoder._decodable('filename'))
self.assertFalse(self.predecoder._decodable('filename.avi'))