PICARD-1961: Keep instrument and other attributes spelling as is

This was introduced very eraly in d923c9a. Originally MB provided a more fixed list of instruments, with instrument names as attributes actually being camel cased.

This is no longer the case and instruments should now be used as given in the API response.
This commit is contained in:
Philipp Wolfer
2020-10-04 17:57:05 +02:00
parent adb420aeda
commit 69b0d0e073
2 changed files with 4 additions and 20 deletions

View File

@@ -30,7 +30,6 @@ from test.picardtestcase import (
from picard import config
from picard.album import Album
from picard.mbjson import (
_decamelcase,
artist_to_metadata,
countries_from_node,
get_score,
@@ -252,11 +251,11 @@ class RecordingCreditsTest(MBJSONTest):
self.assertNotIn('performer:solo', m)
self.assertEqual(m['performer:solo vocals'], 'Anni-Frid Lyngstad')
def test_recording_instrument_decamelcase(self):
def test_recording_instrument_keep_case(self):
m = Metadata()
t = Track("1")
recording_to_metadata(self.json_doc, m, t)
self.assertEqual(m['performer:ewi'], 'Michael Brecker')
self.assertEqual(m['performer:EWI'], 'Michael Brecker')
class TrackTest(MBJSONTest):
@@ -436,12 +435,3 @@ class GetScoreTest(PicardTestCase):
def test_get_score_no_score(self):
self.assertEqual(1.0, get_score({}))
class DecamelcaseTest(PicardTestCase):
def test_decamelcase(self):
self.assertEqual('foo bar', _decamelcase('foo bar'))
self.assertEqual('Foo Bar', _decamelcase('Foo Bar'))
self.assertEqual('Foo Bar', _decamelcase('FooBar'))
self.assertEqual('Foo BAr', _decamelcase('FooBAr'))
self.assertEqual('EWI', _decamelcase('EWI'))