From a0c0ce7e479329b58f70d684d54ef590995f395a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Thu, 1 Jun 2017 02:31:03 +0200 Subject: [PATCH] Fix(/ignore) PEP8/flake8 errors --- whipper/common/program.py | 4 ++-- whipper/test/test_common_program.py | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/whipper/common/program.py b/whipper/common/program.py index 1c186af..ea223de 100644 --- a/whipper/common/program.py +++ b/whipper/common/program.py @@ -254,11 +254,11 @@ class Program: # Find the section of the template with the release name for i, part in enumerate(templateParts): if "%d" in part: - templateParts[i] = self.addDisambiguation(part, self.metadata) + templateParts[i] = self.addDisambiguation(part, self.metadata) # noqa: E501 break else: # No parts of the template contain the release - templateParts[-1] = self.addDisambiguation(templateParts[-1], self.metadata) + templateParts[-1] = self.addDisambiguation(templateParts[-1], self.metadata) # noqa: E501 template = os.path.join(*templateParts) logger.debug('Disambiguated template to %r' % template) diff --git a/whipper/test/test_common_program.py b/whipper/test/test_common_program.py index 9c33c86..dfa1867 100644 --- a/whipper/test/test_common_program.py +++ b/whipper/test/test_common_program.py @@ -121,7 +121,8 @@ class PathTestCase(unittest.TestCase): u'/tmp/Jeff Buckley/Grace') def testDisambiguateOnRelease(self): - """Test that disambiguation gets placed in the same part of the path as the release name. + """Test that disambiguation gets placed in the same part of the path + as the release name. See https://github.com/JoeLametta/whipper/issues/127""" prog = program.Program(config.Config()) @@ -133,15 +134,15 @@ class PathTestCase(unittest.TestCase): md.catalogNumber = 'RHR CD 89' prog.metadata = md templates = { - u'%A/%d - %y': u'Guy Davis/Call Down the Thunder - 1996 (RHR CD 89)', - u'%A - %d - %y': u'Guy Davis - Call Down the Thunder - 1996 (RHR CD 89)', + u'%A/%d - %y': u'Guy Davis/Call Down the Thunder - 1996 (RHR CD 89)', # noqa: E501 + u'%A - %d - %y': u'Guy Davis - Call Down the Thunder - 1996 (RHR CD 89)', # noqa: E501 u'%A/%y/%d': u'Guy Davis/1996/Call Down the Thunder (RHR CD 89)', u'%y/%d/%A': u'1996/Call Down the Thunder (RHR CD 89)/Guy Davis', u'%d/%A/%y': u'Call Down the Thunder (RHR CD 89)/Guy Davis/1996', } for template, expected_path in templates.iteritems(): - path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) + path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) # noqa: E501 self.assertEquals(path, u'/tmp/' + expected_path) def testDisambiguateOnReleaseOnlyOnce(self): @@ -156,12 +157,13 @@ class PathTestCase(unittest.TestCase): prog.metadata = md template = u'%A/%d - %y/%d/%d' - path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) + path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) # noqa: E501 self.assertEquals(path, - u'/tmp/Guy Davis/Call Down the Thunder - 1996 (RHR CD 89)/Call Down the Thunder/Call Down the Thunder') + u'/tmp/Guy Davis/Call Down the Thunder - 1996 (RHR CD 89)/Call Down the Thunder/Call Down the Thunder') # noqa: E501 def testDisambiguateOnNoReleaseTitle(self): - """Test that disambiguation gets added even if there's no release title in the template.""" + """Test that disambiguation gets added even if there's no release + title in the template.""" prog = program.Program(config.Config()) md = mbngs.DiscMetadata() md.artist = 'Guy Davis' @@ -177,7 +179,7 @@ class PathTestCase(unittest.TestCase): } for template, expected_path in templates.iteritems(): - path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) + path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) # noqa: E501 self.assertEquals(path, u'/tmp/' + expected_path) def testAddDisambiguationUnitTest(self):