Commit d90d6198 authored by Priscila Manhaes's avatar Priscila Manhaes

created tests for get and set metadata that stills not implemented

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@43683 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6bcf4c60
...@@ -78,10 +78,12 @@ class FFMPEGHandler(object): ...@@ -78,10 +78,12 @@ class FFMPEGHandler(object):
Keywords Arguments: Keywords Arguments:
base_document -- Boolean variable. if true, the video is also returned base_document -- Boolean variable. if true, the video is also returned
along with the metadata.""" along with the metadata."""
raise NotImplementedError
def setMetadata(self, metadata): def setMetadata(self, metadata={}):
"""Returns a document with new metadata. """Returns a document with new metadata.
Keyword arguments: Keyword arguments:
metadata -- expected an dictionary with metadata. metadata -- expected an dictionary with metadata.
""" """
raise NotImplementedError
...@@ -35,15 +35,23 @@ from cloudooo.handler.tests.handlerTestCase import HandlerTestCase, make_suite ...@@ -35,15 +35,23 @@ from cloudooo.handler.tests.handlerTestCase import HandlerTestCase, make_suite
class TestFFMPEGHandler(HandlerTestCase): class TestFFMPEGHandler(HandlerTestCase):
def afterSetUp(self): def afterSetUp(self):
self.data = open("./data/test.3gp").read() self.data = open("./data/test.ogv").read()
self.input = FFMPEGHandler(self.tmp_url, self.data, "3gp") self.input = FFMPEGHandler(self.tmp_url, self.data, "ogv")
def testConvertVideo(self): def testConvertVideo(self):
"""Test coversion of video to another format""" """Test coversion of video to another format"""
file_detector = magic.Magic() file_detector = magic.Magic()
output_data = self.input.convert("ogv") output_data = self.input.convert("ogg")
file_format = file_detector.from_buffer(output_data) file_format = file_detector.from_buffer(output_data)
self.assertEqual(file_format, 'Ogg data, Theora video') self.assertEqual(file_format, 'Ogg data, Theora video')
def testgetMetadata(self):
"""Test if metadata is extracted from"""
self.assertRaises(NotImplementedError, self.input.getMetadata)
def testsetMetadata(self):
""" Test if metadata are inserted correclty """
self.assertRaises(NotImplementedError, self.input.setMetadata)
def test_suite(): def test_suite():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment