fixed tests
This commit is contained in:
parent
591d2d741f
commit
7db61cc4b4
|
@ -216,17 +216,17 @@ class Metadata(Loggable):
|
|||
# from the file?
|
||||
self.__metadata['MDATA_KEY_MD5'] = mmp.file_md5(fpath,max_length=100)
|
||||
|
||||
try: # emf stuff for testing:
|
||||
if full_mutagen:
|
||||
normalized = global_reader.read_mutagen(fpath)
|
||||
self.logger.info("EMF--------------------")
|
||||
self.logger.info(pformat(normalized))
|
||||
self.logger.info("OLD--------------------")
|
||||
self.logger.info(pformat(self.__metadata))
|
||||
self.logger.info("-----------------------")
|
||||
#try: # emf stuff for testing:
|
||||
#if full_mutagen:
|
||||
#normalized = global_reader.read_mutagen(fpath)
|
||||
#self.logger.info("EMF--------------------")
|
||||
#self.logger.info(pformat(normalized))
|
||||
#self.logger.info("OLD--------------------")
|
||||
#self.logger.info(pformat(self.__metadata))
|
||||
#self.logger.info("-----------------------")
|
||||
|
||||
except Exception as e:
|
||||
self.unexpected_exception(e)
|
||||
#except Exception as e:
|
||||
#self.unexpected_exception(e)
|
||||
|
||||
def is_recorded(self):
|
||||
"""
|
||||
|
|
|
@ -1,11 +1,23 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import unittest
|
||||
from pprint import pprint as pp
|
||||
|
||||
from media.metadata.process import global_reader
|
||||
from media.monitor.metadata import Metadata
|
||||
|
||||
import media.metadata.definitions as defs
|
||||
defs.load_definitions()
|
||||
|
||||
class TestMMP(unittest.TestCase):
|
||||
def test_sanity(self):
|
||||
m = global_reader.read_mutagen("/home/rudi/music/Nightingale.mp3")
|
||||
path = "/home/rudi/music/Nightingale.mp3"
|
||||
m = global_reader.read_mutagen(path)
|
||||
self.assertTrue( len(m) > 0 )
|
||||
n = Metadata(path)
|
||||
self.assertEqual(n.extract(), m)
|
||||
pp(n.extract())
|
||||
print("--------------")
|
||||
pp(m)
|
||||
|
||||
|
||||
if __name__ == '__main__': unittest.main()
|
||||
|
|
Loading…
Reference in New Issue