forked from alastair/python-musicbrainzngs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_mbxml_recording.py
More file actions
28 lines (21 loc) · 961 Bytes
/
test_mbxml_recording.py
File metadata and controls
28 lines (21 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# coding=utf-8
# Tests for parsing of recording queries
import unittest
import os
from test import _common
class GetRecordingTest(unittest.TestCase):
def setUp(self):
self.datadir = os.path.join(os.path.dirname(__file__), "data", "recording")
def testRecordingRelationCreditedAs(self):
# some performance relations have a "credited-as" attribute
res = _common.open_and_parse_test_data(self.datadir, "f606f733-c1eb-43f3-93c1-71994ea611e3-artist-rels.xml")
recording = res["recording"]
rels = recording["artist-relation-list"]
self.assertEqual(4, len(rels))
# Original attributes
attributes = rels[2]["attribute-list"]
self.assertEqual("piano", attributes[0])
# New attribute dict format
attributes = rels[2]["attributes"]
expected = {"attribute": "piano", "credited-as": "Yamaha and Steinway pianos"}
self.assertEqual(expected, attributes[0])