Fix AudioLengthTask for the case where we don't have the decoder, by instead of doing get_state, waiting for an ASYNC_DONE or ERROR message. Properly raise a gst.GError in that case. * morituri/common/task.py: Add some debug. * morituri/test/test_image_image.py: After this fix, we now catch the TYPE_NOT_FOUND because of an empty stream instead of the later gst.QueryError. * morituri/test/test_common_encode.py: Let us know what it is if not a gst.QueryError.
40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
# -*- Mode: Python; test-case-name: morituri.test.test_common_encode -*-
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
|
|
|
import os
|
|
import tempfile
|
|
|
|
import gobject
|
|
gobject.threads_init()
|
|
|
|
import gst
|
|
|
|
from morituri.test import common
|
|
|
|
from morituri.common import task, encode, log
|
|
|
|
from morituri.test import common
|
|
|
|
class PathTestCase(common.TestCase):
|
|
def _testSuffix(self, suffix):
|
|
self.runner = task.SyncRunner(verbose=False)
|
|
fd, path = tempfile.mkstemp(
|
|
suffix=suffix)
|
|
encodetask = encode.EncodeTask(path, path + '.out',
|
|
encode.WavProfile())
|
|
e = self.assertRaises(task.TaskException, self.runner.run,
|
|
encodetask, verbose=False)
|
|
self.failUnless(isinstance(e.exception, gst.QueryError),
|
|
"%r is not a gst.QueryError" % e.exception)
|
|
os.unlink(path)
|
|
|
|
def testUnicodePath(self):
|
|
# this test makes sure we can checksum a unicode path
|
|
self._testSuffix(u'morituri.test.B\xeate Noire.empty')
|
|
|
|
def testSingleQuote(self):
|
|
self._testSuffix(u"morituri.test.Guns 'N Roses")
|
|
|
|
def testDoubleQuote(self):
|
|
self._testSuffix(u'morituri.test.12" edit')
|