cc-4105: refactored metadata into it's own file

This commit is contained in:
Rudi Grinberg 2012-07-19 15:41:09 -04:00
parent 09303a96d3
commit 1c09907fd5
5 changed files with 149 additions and 22 deletions

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import unittest
import os
import media.monitor.pure as mmp
class TestMMP(unittest.TestCase):
@ -51,4 +52,12 @@ class TestMMP(unittest.TestCase):
# for recorded it should be something like this
# ./recorded/2012/07/2012-07-09-17-55-00-Untitled Show-256kbps.ogg
def test_file_md5(self):
p = os.path.realpath(__file__)
m1 = mmp.file_md5(p)
m2 = mmp.file_md5(p,10)
self.assertTrue( m1 != m2 )
self.assertRaises( ValueError, lambda : mmp.file_md5('/bull/shit/path') )
self.assertTrue( m1 == mmp.file_md5(p) )
if __name__ == '__main__': unittest.main()