pep8 fixes

This commit is contained in:
Thomas Vander Stichele
2012-11-10 22:24:50 +00:00
parent e3cce37de4
commit b9d6807065
6 changed files with 22 additions and 5 deletions

View File

@@ -57,6 +57,7 @@ class TestCase(unittest.TestCase):
assertRaises = failUnlessRaises
class UnicodeTestMixin:
# A helper mixin to skip tests if we're not in a UTF-8 locale
try:
@@ -65,4 +66,3 @@ class UnicodeTestMixin:
skip = 'No UTF-8 locale'
except OSError:
pass

View File

@@ -13,4 +13,3 @@ class ListifyTestCase(common.TestCase):
def testList(self):
lst = ['/dev/scd0', '/dev/sr0']
self.assertEquals(drive._listify(lst), lst)

View File

@@ -117,4 +117,3 @@ class UnicodeAudioLengthPathTestCase(AudioLengthPathTestCase, tcommon.UnicodeTes
def testUnicodePath(self):
# this test makes sure we can checksum a unicode path
self._testSuffix(u'morituri.test.B\xeate Noire.empty')

View File

@@ -10,7 +10,9 @@ from morituri.image import toc
from morituri.test import common
class CureTestCase(common.TestCase):
def setUp(self):
self.toc = toc.TocFile(os.path.join(os.path.dirname(__file__),
u'cure.toc'))
@@ -91,7 +93,10 @@ class CureTestCase(common.TestCase):
'3/c/4/dBAR-013-0019d4c3-00fe8924-b90c650d.bin')
# Bloc Party - Silent Alarm has a Hidden Track One Audio
class BlocTestCase(common.TestCase):
def setUp(self):
self.toc = toc.TocFile(os.path.join(os.path.dirname(__file__),
u'bloc.toc'))
@@ -114,6 +119,7 @@ class BlocTestCase(common.TestCase):
self.assertEquals(t.getIndex(1).relative, 15220)
# This disc has a pre-gap, so is a good test for .CUE writing
def testConvertCue(self):
#self.toc.table.absolutize()
self.failUnless(self.toc.table.hasTOC())
@@ -138,7 +144,10 @@ class BlocTestCase(common.TestCase):
'e/d/2/dBAR-013-001af2de-0105994e-ad0be00d.bin')
# The Breeders - Mountain Battles has CDText
class BreedersTestCase(common.TestCase):
def setUp(self):
self.toc = toc.TocFile(os.path.join(os.path.dirname(__file__),
u'breeders.toc'))
@@ -164,7 +173,10 @@ class BreedersTestCase(common.TestCase):
self.assertEquals(cue, ref)
# Ladyhawke has a data track
class LadyhawkeTestCase(common.TestCase):
def setUp(self):
self.toc = toc.TocFile(os.path.join(os.path.dirname(__file__),
u'ladyhawke.toc'))
@@ -189,7 +201,9 @@ class LadyhawkeTestCase(common.TestCase):
def testDuration(self):
self.assertEquals(self.toc.table.duration(), 2761413)
class CapitalMergeTestCase(common.TestCase):
def setUp(self):
self.toc1 = toc.TocFile(os.path.join(os.path.dirname(__file__),
u'capital.1.toc'))
@@ -206,7 +220,6 @@ class CapitalMergeTestCase(common.TestCase):
self.table = copy.deepcopy(self.toc1.table)
self.table.merge(self.toc2.table)
def testCDDBId(self):
self.table.absolutize()
self.assertEquals(self.table.getCDDBDiscId(), 'b910140c')
@@ -226,6 +239,7 @@ class CapitalMergeTestCase(common.TestCase):
class UnicodeTestCase(common.TestCase, common.UnicodeTestMixin):
def setUp(self):
# we copy the normal non-utf8 filename to a utf-8 filename
# in this test because builds with LANG=C fail if we include

View File

@@ -6,6 +6,7 @@ import unittest
from morituri.program import cdparanoia
class ParseTestCase(unittest.TestCase):
def setUp(self):
@@ -23,6 +24,7 @@ class ParseTestCase(unittest.TestCase):
q = '%.01f %%' % (self._parser.getTrackQuality() * 100.0, )
self.assertEquals(q, '99.7 %')
class ErrorTestCase(unittest.TestCase):
def setUp(self):
@@ -39,4 +41,3 @@ class ErrorTestCase(unittest.TestCase):
q = '%.01f %%' % (self._parser.getTrackQuality() * 100.0, )
self.assertEquals(q, '79.6 %')

View File

@@ -6,11 +6,15 @@ import unittest
from morituri.program import cdrdao
class FakeTask:
def setProgress(self, value):
pass
class ParseTestCase(unittest.TestCase):
def setUp(self):
path = os.path.join(os.path.dirname(__file__),
'cdrdao.readtoc.progress')