* HACKING:

Note unicode handling.
	* morituri/test/test_image_image.py:
	* morituri/image/table.py:
	* morituri/program/cdparanoia.py:
	* morituri/common/checksum.py:
	  Use unicode for paths.
	  Use repr for path representation.
	* morituri/test/test_common_checksum.py:
	  Add test for unicode audio file name.
This commit is contained in:
Thomas Vander Stichele
2009-09-11 15:40:44 +00:00
parent 9a15e890e0
commit e6f13ccf84
7 changed files with 68 additions and 13 deletions

View File

@@ -12,6 +12,8 @@ import gst
from morituri.common import task, checksum
from morituri.test import common
def h(i):
return "0x%08x" % i
@@ -19,9 +21,19 @@ class EmptyTestCase(unittest.TestCase):
def testEmpty(self):
# this test makes sure that checksumming empty files doesn't hang
self.runner = task.SyncRunner(verbose=False)
fd, path = tempfile.mkstemp(suffix='morituri.test.empty')
fd, path = tempfile.mkstemp(suffix=u'morituri.test.empty')
checksumtask = checksum.ChecksumTask(path)
# FIXME: do we want a specific error for this ?
self.assertRaises(gst.QueryError, self.runner.run,
checksumtask, verbose=False)
os.unlink(path)
def testUnicodePath(self):
# this test makes sure we can checksum a unicode path
self.runner = task.SyncRunner(verbose=False)
fd, path = tempfile.mkstemp(
suffix=u'morituri.test.B\xeate Noire.empty')
checksumtask = checksum.ChecksumTask(path)
self.assertRaises(gst.QueryError, self.runner.run,
checksumtask, verbose=False)
os.unlink(path)

View File

@@ -16,7 +16,7 @@ def h(i):
class TrackSingleTestCase(unittest.TestCase):
def setUp(self):
self.image = image.Image(os.path.join(os.path.dirname(__file__),
'track-single.cue'))
u'track-single.cue'))
self.runner = task.SyncRunner(verbose=False)
self.image.setup(self.runner)
@@ -46,7 +46,7 @@ class TrackSingleTestCase(unittest.TestCase):
class TrackSeparateTestCase(unittest.TestCase):
def setUp(self):
self.image = image.Image(os.path.join(os.path.dirname(__file__),
'track-separate.cue'))
u'track-separate.cue'))
self.runner = task.SyncRunner(verbose=False)
self.image.setup(self.runner)
@@ -75,7 +75,7 @@ class TrackSeparateTestCase(unittest.TestCase):
class AudioLengthTestCase(unittest.TestCase):
def testLength(self):
path = os.path.join(os.path.dirname(__file__), 'track.flac')
path = os.path.join(os.path.dirname(__file__), u'track.flac')
t = image.AudioLengthTask(path)
runner = task.SyncRunner()
runner.run(t, verbose=False)