From f3e3748d7570a8a514650dfbc844570e7e678d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederik=20=E2=80=9CFreso=E2=80=9D=20S=2E=20Olesen?= Date: Sat, 29 Apr 2017 14:29:53 +0200 Subject: [PATCH] Test that disambiguation is only added once --- whipper/test/test_common_program.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/whipper/test/test_common_program.py b/whipper/test/test_common_program.py index 62cef64..41b87cd 100644 --- a/whipper/test/test_common_program.py +++ b/whipper/test/test_common_program.py @@ -143,3 +143,19 @@ class PathTestCase(unittest.TestCase): for template, expected_path in templates.iteritems(): path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) self.assertEquals(path, u'/tmp/' + expected_path) + + def testDisambiguateOnReleaseOnlyOnce(self): + """Test that disambiguation gets added only once.""" + prog = program.Program(config.Config()) + md = mbngs.DiscMetadata() + md.artist = 'Guy Davis' + md.sortName = 'Davis, Guy' + md.title = 'Call Down the Thunder' + md.release = '1996' + md.catalogNumber = 'RHR CD 89' + prog.metadata = md + template = u'%A/%d - %y/%d/%d' + + path = prog.getPath(u'/tmp', template, 'mbdiscid', 0, disambiguate=True) + self.assertEquals(path, + u'/tmp/Guy Davis/Call Down the Thunder - 1996 (RHR CD 89)/Call Down the Thunder/Call Down the Thunder')