mirror of
https://github.com/fergalmoran/picard.git
synced 2026-01-23 17:07:00 +00:00
That can happen if a new cover art type is added in MB that Picard doesn't yet know about. Instead of raising a KeyError (and crashing), just return the raw type, which is good enough until we have something better to show.
23 lines
694 B
Python
23 lines
694 B
Python
#!/usr/bin/env python
|
|
# coding: utf-8
|
|
import os.path
|
|
import shutil
|
|
import tempfile
|
|
import unittest
|
|
|
|
from picard.coverart.utils import translate_caa_type
|
|
from picard.i18n import setup_gettext
|
|
|
|
|
|
class CaaTypeTranslationTest(unittest.TestCase):
|
|
def setUp(self):
|
|
# we are using temporary locales for tests
|
|
self.tmp_path = tempfile.mkdtemp()
|
|
self.localedir = os.path.join(self.tmp_path, 'locale')
|
|
self.addCleanup(shutil.rmtree, self.tmp_path)
|
|
setup_gettext(self.localedir, "C")
|
|
|
|
def test_translating_unknown_types_returns_input(self):
|
|
testtype = "ThisIsAMadeUpCoverArtTypeName"
|
|
self.assertEqual(translate_caa_type(testtype), testtype)
|