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):
Keywords Arguments:
base_document -- Boolean variable. if true, the video is also returned
along with the metadata."""
raise NotImplementedError
def setMetadata(self, metadata):
def setMetadata(self, metadata={}):
"""Returns a document with new metadata.
Keyword arguments:
metadata -- expected an dictionary with metadata.
"""
raise NotImplementedError
......@@ -35,16 +35,24 @@ from cloudooo.handler.tests.handlerTestCase import HandlerTestCase, make_suite
class TestFFMPEGHandler(HandlerTestCase):
def afterSetUp(self):
self.data = open("./data/test.3gp").read()
self.input = FFMPEGHandler(self.tmp_url, self.data, "3gp")
self.data = open("./data/test.ogv").read()
self.input = FFMPEGHandler(self.tmp_url, self.data, "ogv")
def testConvertVideo(self):
"""Test coversion of video to another format"""
file_detector = magic.Magic()
output_data = self.input.convert("ogv")
output_data = self.input.convert("ogg")
file_format = file_detector.from_buffer(output_data)
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():
return make_suite(TestFFMPEGHandler)
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