Add tests for mbjson

This commit is contained in:
Sambhav Kothari
2017-07-13 02:53:50 +05:30
parent 21d4432096
commit ee8a56b48d
8 changed files with 2043 additions and 2 deletions

View File

@@ -0,0 +1,38 @@
{
"gender":"Male",
"type-id":"b6e035f4-3ce9-331c-97df-83397230b0df",
"id":"b8a7c51f-362c-4dcb-a259-bc6e0095f0a6",
"gender-id":"36d3d30a-839d-3eda-8cb3-29be4384e4a9",
"type":"Person",
"ipis":[
"00600664284"
],
"area":{
"iso-3166-1-codes":[
"GB"
],
"disambiguation":"",
"id":"8a754a16-0027-3a29-b6d7-2b40ea0481ed",
"name":"United Kingdom",
"sort-name":"United Kingdom"
},
"begin_area":{
"disambiguation":"",
"id":"3bad79a2-895a-49ff-8277-fe683fade6b2",
"name":"Hebden Bridge",
"sort-name":"Hebden Bridge"
},
"country":"GB",
"disambiguation":"famous UK singer-songwriter",
"name":"Ed Sheeran",
"sort-name":"Sheeran, Ed",
"end_area":null,
"isnis":[
"0000000364434564"
],
"life-span":{
"end":null,
"begin":"1991-02-17",
"ended":false
}
}

View File

@@ -0,0 +1,39 @@
{
"country":"GB",
"barcode":"",
"packaging":"Cardboard/Paper Sleeve",
"disambiguation":"",
"cover-art-archive":{
"darkened":false,
"back":false,
"count":1,
"artwork":true,
"front":true
},
"date":"1986-03",
"status-id":"4e304316-386d-3409-af2e-78857eec5cfe",
"asin":null,
"quality":"normal",
"title":"Master of Puppets",
"text-representation":{
"script":"Latn",
"language":"eng"
},
"release-events":[
{
"area":{
"disambiguation":"",
"iso-3166-1-codes":[
"GB"
],
"name":"United Kingdom",
"id":"8a754a16-0027-3a29-b6d7-2b40ea0481ed",
"sort-name":"United Kingdom"
},
"date":"1986-03"
}
],
"id":"03e4ebe1-0a44-411c-8e19-78e0768603f8",
"status":"Official",
"packaging-id":"f7101ce3-0384-39ce-9fde-fbbd0044d35f"
}

View File

@@ -0,0 +1,11 @@
{
"format-id":"3e9080b0-5e6c-34ab-bd15-f526b6306a64",
"track-count":10,
"position":1,
"title":"",
"track-offset":0,
"format":"12\" Vinyl",
"tracks":[
]
}

View File

@@ -0,0 +1,632 @@
{
"disambiguation":"",
"id":"cb2cc207-8125-445c-9ef9-6ea44eee959a",
"aliases":[
{
"type":null,
"sort-name":"Thinking Out Loud",
"primary":null,
"end":null,
"ended":false,
"begin":null,
"locale":null,
"name":"Thinking Out Loud",
"type-id":null
}
],
"video":false,
"isrcs":[
"GBAHS1400099"
],
"artist-credit":[
{
"name":"Ed Sheeran",
"joinphrase":"",
"artist":{
"disambiguation":"famous UK singer-songwriter",
"name":"Ed Sheeran",
"sort-name":"Sheeran, Ed",
"id":"b8a7c51f-362c-4dcb-a259-bc6e0095f0a6"
}
}
],
"relations":[
{
"target-credit":"",
"begin":null,
"attributes":[
],
"direction":"backward",
"attribute-values":{
},
"type-id":"451076df-61cf-46ab-9921-555cab2f050d",
"source-credit":"",
"type":"DJ-mix",
"target-type":"recording",
"recording":{
"disambiguation":"",
"aliases":[
],
"id":"89f35c6f-84f4-4b5d-8966-ef2572faf230",
"isrcs":[
],
"video":false,
"length":317000,
"artist-credit":[
{
"artist":{
"disambiguation":"",
"sort-name":"Earworm, DJ",
"name":"DJ Earworm",
"id":"e407802a-bfc3-4979-a5e1-3196ccf9c8d9"
},
"name":"DJ Earworm",
"joinphrase":""
}
],
"title":"United State of Pop 2015 (50 Shades of Pop)"
},
"end":null,
"ended":false
},
{
"attributes":[
],
"begin":null,
"target-credit":"",
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"attribute-values":{
},
"direction":"forward",
"work":{
"id":"dc469dc8-198e-42e5-b5a7-6be2f0a95ac0",
"language":"eng",
"aliases":[
],
"type":null,
"disambiguation":"",
"languages":[
"eng"
],
"attributes":[
],
"title":"Thinking Out Loud",
"relations":[
{
"direction":"backward",
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"attribute-values":{
},
"attributes":[
"cover"
],
"begin":null,
"target-credit":"",
"type":"performance",
"source-credit":"",
"recording":{
"length":224000,
"artist-credit":[
{
"artist":{
"id":"31c0df3c-2d23-41d3-a772-ec3cfc3cc625",
"disambiguation":"",
"sort-name":"Kidz Bop",
"name":"Kidz Bop"
},
"joinphrase":"",
"name":"Kidz Bop"
}
],
"title":"Thinking Out Loud",
"disambiguation":"",
"aliases":[
],
"id":"5718a458-fefe-423a-9300-9758cdd0f69e",
"isrcs":[
],
"video":false
},
"ended":false,
"target-type":"recording",
"end":null
},
{
"begin":null,
"attributes":[
"cover"
],
"target-credit":"",
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"attribute-values":{
},
"direction":"backward",
"target-type":"recording",
"recording":{
"title":"Thinking out loud",
"artist-credit":[
{
"name":"Sofia Truta",
"joinphrase":"",
"artist":{
"id":"45440d49-cee2-458e-a558-9a22585fa0ce",
"disambiguation":"",
"name":"Sofia Truta",
"sort-name":"Truta, Sofia"
}
}
],
"length":222179,
"video":false,
"isrcs":[
],
"id":"5d240d0e-bbf5-4190-872d-116f532d9be2",
"aliases":[
],
"disambiguation":""
},
"end":null,
"ended":false,
"source-credit":"",
"type":"performance"
},
{
"target-credit":"",
"attributes":[
"cover"
],
"begin":null,
"attribute-values":{
},
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"direction":"backward",
"target-type":"recording",
"recording":{
"disambiguation":"",
"video":false,
"isrcs":[
],
"id":"6f6a7b2b-1b68-4b82-9fab-4cf952167e90",
"aliases":[
],
"artist-credit":[
{
"joinphrase":"",
"name":"Luke Wade",
"artist":{
"name":"Luke Wade",
"sort-name":"Wade, Luke",
"disambiguation":"",
"id":"25f90957-0cdd-45e4-a1ab-3362dc5681fa"
}
}
],
"length":230000,
"title":"Thinking Out Loud"
},
"ended":false,
"end":null,
"source-credit":"",
"type":"performance"
},
{
"attribute-values":{
},
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"direction":"backward",
"target-credit":"",
"attributes":[
"cover"
],
"begin":null,
"recording":{
"aliases":[
],
"id":"c8133db7-f5ee-429d-90dd-586ad40b07e8",
"isrcs":[
],
"video":false,
"disambiguation":"",
"title":"Thinking Out Loud",
"length":253000,
"artist-credit":[
{
"name":"Amy Wadge",
"joinphrase":"",
"artist":{
"id":"e6523192-ca22-40ab-a82c-995b82594031",
"disambiguation":"",
"sort-name":"Wadge, Amy",
"name":"Amy Wadge"
}
}
]
},
"target-type":"recording",
"ended":false,
"end":null,
"source-credit":"",
"type":"performance"
},
{
"attribute-values":{
},
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"direction":"backward",
"target-credit":"",
"attributes":[
"partial"
],
"begin":null,
"recording":{
"title":"Thinking Out Loud / Four Five Seconds",
"length":232571,
"artist-credit":[
{
"artist":{
"id":"18689349-0ec3-4fe0-b9da-bec4899560f0",
"disambiguation":"",
"sort-name":"Clark, Liddy",
"name":"Liddy Clark"
},
"name":"Liddy Clark",
"joinphrase":""
}
],
"isrcs":[
],
"video":false,
"aliases":[
],
"id":"c8e0a6bf-3034-4879-a865-34fd89556054",
"disambiguation":""
},
"ended":false,
"target-type":"recording",
"end":null,
"source-credit":"",
"type":"performance"
},
{
"attributes":[
],
"begin":null,
"target-credit":"",
"direction":"backward",
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"attribute-values":{
},
"type":"performance",
"source-credit":"",
"end":null,
"recording":{
"video":false,
"isrcs":[
"GBAHS1400099"
],
"id":"cb2cc207-8125-445c-9ef9-6ea44eee959a",
"aliases":[
{
"name":"Thinking Out Loud",
"type-id":null,
"begin":null,
"locale":null,
"type":null,
"sort-name":"Thinking Out Loud",
"primary":null,
"ended":false,
"end":null
}
],
"disambiguation":"",
"title":"Thinking Out Loud",
"artist-credit":[
{
"artist":{
"disambiguation":"famous UK singer-songwriter",
"name":"Ed Sheeran",
"sort-name":"Sheeran, Ed",
"id":"b8a7c51f-362c-4dcb-a259-bc6e0095f0a6"
},
"joinphrase":"",
"name":"Ed Sheeran"
}
],
"length":281000
},
"target-type":"recording",
"ended":false
},
{
"ended":false,
"recording":{
"video":false,
"isrcs":[
],
"id":"cc5bc2ea-5ff8-48e0-a416-dde9a942c53c",
"aliases":[
],
"disambiguation":"",
"title":"Thinking Out Loud",
"artist-credit":[
{
"artist":{
"disambiguation":"classical violinist",
"sort-name":"Garrett, David",
"name":"David Garrett",
"id":"88be1fb5-0112-4549-9608-526591c7f415"
},
"joinphrase":"",
"name":"David Garrett"
}
],
"length":223000
},
"target-type":"recording",
"end":null,
"type":"performance",
"source-credit":"",
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"attribute-values":{
},
"direction":"backward",
"begin":null,
"attributes":[
"cover",
"instrumental"
],
"target-credit":""
},
{
"target-credit":"",
"attributes":[
"cover"
],
"begin":null,
"attribute-values":{
},
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0",
"direction":"backward",
"recording":{
"length":219374,
"artist-credit":[
{
"artist":{
"id":"b25a57f6-2ddb-4f29-9d12-b0c308cfc845",
"name":"Tom Law",
"sort-name":"Law, Tom",
"disambiguation":""
},
"name":"Tom Law",
"joinphrase":""
}
],
"title":"Thinking Out Loud",
"disambiguation":"",
"isrcs":[
],
"video":false,
"aliases":[
],
"id":"e5705f6f-f450-49ab-9397-96c6b030e251"
},
"end":null,
"target-type":"recording",
"ended":false,
"type":"performance",
"source-credit":""
},
{
"source-credit":"",
"type":"performance",
"end":null,
"recording":{
"disambiguation":"",
"isrcs":[
],
"video":false,
"aliases":[
],
"id":"fa9f3d37-3e43-428f-8a97-49311ff10775",
"length":163000,
"artist-credit":[
{
"name":"Soul System",
"joinphrase":"",
"artist":{
"id":"f3a47c64-e32a-473d-af34-b393d0c2f302",
"sort-name":"Soul System",
"name":"Soul System",
"disambiguation":"X-Factor 10 Italy"
}
}
],
"title":"Thinking out Loud"
},
"target-type":"recording",
"ended":false,
"target-credit":"",
"begin":null,
"attributes":[
"cover"
],
"direction":"backward",
"attribute-values":{
},
"type-id":"a3005666-a872-32c3-ad06-98af558e99b0"
},
{
"type":"wikidata",
"source-credit":"",
"ended":false,
"target-type":"url",
"end":null,
"target-credit":"",
"begin":null,
"attributes":[
],
"direction":"backward",
"attribute-values":{
},
"url":{
"id":"62a2695d-9218-487a-8b5e-d05dd00aa202",
"resource":"https://www.wikidata.org/wiki/Q17332468"
},
"type-id":"587fdd8f-080e-46a9-97af-6425ebbcb3a2"
},
{
"target-type":"artist",
"ended":false,
"end":null,
"source-credit":"",
"type":"writer",
"attributes":[
],
"artist":{
"name":"Ed Sheeran",
"sort-name":"Sheeran, Ed",
"disambiguation":"famous UK singer-songwriter",
"aliases":[
],
"id":"b8a7c51f-362c-4dcb-a259-bc6e0095f0a6"
},
"begin":null,
"target-credit":"",
"type-id":"a255bca1-b157-4518-9108-7b147dc3fc68",
"attribute-values":{
},
"direction":"backward"
},
{
"source-credit":"",
"type":"writer",
"ended":false,
"target-type":"artist",
"end":null,
"direction":"backward",
"attribute-values":{
},
"type-id":"a255bca1-b157-4518-9108-7b147dc3fc68",
"target-credit":"",
"begin":null,
"artist":{
"name":"Amy Wadge",
"sort-name":"Wadge, Amy",
"disambiguation":"",
"aliases":[
],
"id":"e6523192-ca22-40ab-a82c-995b82594031"
},
"attributes":[
]
}
],
"type-id":null,
"iswcs":[
]
},
"ended":false,
"target-type":"work",
"end":null,
"type":"performance",
"source-credit":""
},
{
"end":null,
"target-type":"artist",
"ended":false,
"type":"performer",
"source-credit":"",
"target-credit":"",
"artist":{
"id":"b8a7c51f-362c-4dcb-a259-bc6e0095f0a6",
"aliases":[
],
"sort-name":"Sheeran, Ed",
"name":"Ed Sheeran",
"disambiguation":"famous UK singer-songwriter"
},
"attributes":[
],
"begin":null,
"attribute-values":{
},
"type-id":"628a9658-f54c-4142-b0c0-95f031b544da",
"direction":"backward"
},
{
"source-credit":"",
"type":"vocal",
"target-type":"artist",
"end":null,
"ended":false,
"direction":"backward",
"type-id":"0fdbe3c6-7700-4a31-ae54-b53f06ae1cfa",
"attribute-values":{
},
"artist":{
"aliases":[
],
"id":"b8a7c51f-362c-4dcb-a259-bc6e0095f0a6",
"disambiguation":"famous UK singer-songwriter",
"sort-name":"Sheeran, Ed",
"name":"Ed Sheeran"
},
"begin":null,
"attributes":[
],
"target-credit":""
}
],
"length":281000,
"title":"Thinking Out Loud"
}

View File

@@ -0,0 +1,290 @@
{
"release-group": {
"first-release-date": "1973-03-24",
"artist-credit": [
{
"name": "Pink Floyd",
"artist": {
"id": "83d91898-7763-47d7-b03b-b92132375c47",
"disambiguation": "",
"sort-name": "Pink Floyd",
"name": "Pink Floyd"
},
"joinphrase": ""
}
],
"primary-type": "Album",
"id": "f5093c06-23e3-404f-aeaa-40f72885ee3a",
"title": "The Dark Side of the Moon",
"disambiguation": "",
"secondary-type-ids": [
],
"primary-type-id": "f529b476-6e62-324f-b0aa-1f3e33d313fc",
"secondary-types": [
],
"aliases": [
]
},
"aliases": [
],
"cover-art-archive": {
"front": true,
"back": true,
"count": 10,
"artwork": true,
"darkened": false
},
"media": [
{
"position": 1,
"track-count": 10,
"format-id": "3e9080b0-5e6c-34ab-bd15-f526b6306a64",
"title": "",
"format": "12\" Vinyl",
"track-offset": 0
}
],
"title": "The Dark Side of the Moon",
"date": "1973-03-24",
"packaging": "Gatefold Cover",
"artist-credit": [
{
"artist": {
"id": "83d91898-7763-47d7-b03b-b92132375c47",
"disambiguation": "",
"aliases": [
{
"end": null,
"primary": null,
"name": "Floyd",
"type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e",
"ended": false,
"type": "Search hint",
"locale": null,
"sort-name": "Floyd",
"begin": null
},
{
"begin": null,
"sort-name": "Pink Floid",
"locale": null,
"type": "Search hint",
"ended": false,
"type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e",
"name": "Pink Floid",
"end": null,
"primary": null
},
{
"end": null,
"primary": true,
"type-id": "894afba6-2816-3c24-8072-eadb66bd04bc",
"name": "Pink Floyd",
"ended": false,
"type": "Artist name",
"locale": "en",
"sort-name": "Pink Floyd",
"begin": null
},
{
"type": "Search hint",
"locale": null,
"sort-name": "The Pink Floyd",
"begin": null,
"primary": null,
"end": null,
"name": "The Pink Floyd",
"type-id": "1937e404-b981-3cb7-8151-4c86ebfc8d8e",
"ended": false
},
{
"ended": false,
"primary": true,
"end": null,
"name": "ピンク・フロイド",
"type-id": "894afba6-2816-3c24-8072-eadb66bd04bc",
"sort-name": "ピンク・フロイド",
"begin": null,
"type": "Artist name",
"locale": "ja"
},
{
"sort-name": "핑크 플로이드",
"begin": null,
"type": "Artist name",
"locale": "ko",
"ended": false,
"primary": true,
"end": null,
"type-id": "894afba6-2816-3c24-8072-eadb66bd04bc",
"name": "핑크 플로이드"
}
],
"sort-name": "Pink Floyd",
"name": "Pink Floyd"
},
"joinphrase": "",
"name": "Pink Floyd"
}
],
"release-events": [
{
"date": "1973-03-24",
"area": {
"disambiguation": "",
"sort-name": "United Kingdom",
"iso-3166-1-codes": [
"GB"
],
"id": "8a754a16-0027-3a29-b6d7-2b40ea0481ed",
"name": "United Kingdom"
}
}
],
"quality": "normal",
"asin": "b123",
"status": "Official",
"text-representation": {
"language": "eng",
"script": "Latn"
},
"barcode": "123",
"tags": [
],
"relations": [
{
"attributes": [
],
"target-credit": "George Hardie N.T.A.",
"source-credit": "",
"target-type": "artist",
"type": "design/illustration",
"attribute-values": {
},
"begin": null,
"type-id": "307e95dd-88b5-419b-8223-b146d4a0d439",
"end": null,
"direction": "backward",
"artist": {
"id": "89931942-3182-4448-8e63-0c2ce90f1f81",
"aliases": [
],
"sort-name": "Hardie, George",
"disambiguation": "",
"name": "George Hardie"
},
"ended": false
},
{
"attributes": [
],
"target-credit": "",
"source-credit": "",
"type": "design/illustration",
"target-type": "artist",
"attribute-values": {
},
"begin": null,
"type-id": "307e95dd-88b5-419b-8223-b146d4a0d439",
"end": null,
"direction": "backward",
"ended": false,
"artist": {
"name": "Hipgnosis",
"id": "fd1a4572-59ca-40f2-8f55-b82be28bb0ff",
"aliases": [
],
"sort-name": "Hipgnosis",
"disambiguation": "UK art design group"
}
},
{
"end": null,
"direction": "forward",
"type-id": "4a78823c-1c53-4176-a5f3-58026c76f2bc",
"ended": false,
"target-credit": "",
"source-credit": "",
"url": {
"resource": "https://www.discogs.com/release/1873013",
"id": "49af9dc2-196e-42be-bdf6-ea320eaa1dab"
},
"target-type": "url",
"type": "discogs",
"attributes": [
],
"attribute-values": {
},
"begin": null
},
{
"attribute-values": {
},
"begin": null,
"type": "photography",
"target-type": "artist",
"target-credit": "",
"source-credit": "",
"attributes": [
],
"ended": false,
"artist": {
"id": "fd1a4572-59ca-40f2-8f55-b82be28bb0ff",
"sort-name": "Hipgnosis",
"aliases": [
],
"disambiguation": "UK art design group",
"name": "Hipgnosis"
},
"end": null,
"direction": "backward",
"type-id": "0b58dc9b-9c49-4b19-bb58-9c06d41c8fbf"
}
],
"id": "b84ee12a-09ef-421b-82de-0441a926375b",
"packaging-id": "e724a489-a7e8-30a1-a17c-30dfd6831202",
"disambiguation": "",
"label-info": [
{
"catalog-number": "SHVL 804",
"label": {
"disambiguation": "UK based sub-label of EMI, re-activated in 2013 under Capitol Music Group in Hollywood, CA",
"aliases": [
{
"locale": null,
"type": null,
"begin": null,
"sort-name": "Harvest Records",
"type-id": null,
"name": "Harvest Records",
"primary": null,
"end": null,
"ended": false
}
],
"sort-name": "Harvest",
"id": "993af7f6-bb99-456b-83e7-5e728ea80a0e",
"label-code": 1305,
"name": "Harvest"
}
}
],
"country": "GB",
"status-id": "4e304316-386d-3409-af2e-78857eec5cfe"
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,13 @@
{
"length":68346,
"recording":{
"disambiguation":"original stereo mix",
"length":68346,
"video":false,
"title":"Speak to Me",
"id":"bef3fddb-5aca-49f5-b2fd-d56a23268d63"
},
"number":"A1",
"id":"d4156411-b884-368f-a4cb-7c0101a557a2",
"title":"Speak to Me"
}

View File

@@ -177,7 +177,6 @@ class CountryListTest(unittest.TestCase):
with open(os.path.join('test', 'data', 'ws_data', 'country.json')) as f:
self.json_doc = json.loads(f.read())
def test_release_group(self):
m = Metadata()
def test_country_from_node(self):
country_list = country_list_from_node(self.json_doc)
self.assertEqual(['GB'], country_list)