From d0435dc2abc3a52ffc57508b4f08fe115781f73d Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 19 Nov 2012 20:44:53 +0000 Subject: [PATCH] * morituri/test/test_common_encode.py: Work around https://bugzilla.gnome.org/show_bug.cgi?id=688625 --- ChangeLog | 5 +++++ morituri/test/test_common_encode.py | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9c0879..d1bba10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-11-19 Thomas Vander Stichele + + * morituri/test/test_common_encode.py: + Work around https://bugzilla.gnome.org/show_bug.cgi?id=688625 + 2012-11-19 Thomas Vander Stichele * morituri/test/common.py: diff --git a/morituri/test/test_common_encode.py b/morituri/test/test_common_encode.py index 5dcee01..4a74759 100644 --- a/morituri/test/test_common_encode.py +++ b/morituri/test/test_common_encode.py @@ -19,22 +19,31 @@ from morituri.test import common class PathTestCase(common.TestCase): def _testSuffix(self, suffix): + # because of https://bugzilla.gnome.org/show_bug.cgi?id=688625 + # we first create the file with a 'normal' filename, then rename self.runner = task.SyncRunner(verbose=False) - fd, path = tempfile.mkstemp(suffix=suffix) + fd, path = tempfile.mkstemp() + cmd = "gst-launch " \ "audiotestsrc num-buffers=100 samplesperbuffer=1024 ! " \ "audioconvert ! audio/x-raw-int,width=16,depth=16,channels =2 ! " \ "wavenc ! " \ "filesink location=\"%s\" > /dev/null 2>&1" % ( gstreamer.quoteParse(path).encode('utf-8'), ) + self.debug('Running cmd %r' % cmd) os.system(cmd) self.failUnless(os.path.exists(path)) - encodetask = encode.EncodeTask(path, path + '.out', + os.close(fd) + + fd, newpath = tempfile.mkstemp(suffix=suffix) + os.rename(path, newpath) + + encodetask = encode.EncodeTask(newpath, newpath + '.out', encode.WavProfile()) self.runner.run(encodetask, verbose=False) os.close(fd) - os.unlink(path) - os.unlink(path + '.out') + os.unlink(newpath) + os.unlink(newpath + '.out') class UnicodePathTestCase(PathTestCase, common.UnicodeTestMixin):