Skip to content

Commit

Permalink
Add more test data
Browse files Browse the repository at this point in the history
  • Loading branch information
samj1912 committed Jul 13, 2017
1 parent a3254f3 commit 43a33c5
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 12 deletions.
2 changes: 1 addition & 1 deletion test/data/ws_data/artist.json
Expand Up @@ -35,4 +35,4 @@
"begin":"1991-02-17",
"ended":false
}
}
}
2 changes: 1 addition & 1 deletion test/data/ws_data/country.json
Expand Up @@ -36,4 +36,4 @@
"id":"03e4ebe1-0a44-411c-8e19-78e0768603f8",
"status":"Official",
"packaging-id":"f7101ce3-0384-39ce-9fde-fbbd0044d35f"
}
}
2 changes: 1 addition & 1 deletion test/data/ws_data/media.json
Expand Up @@ -8,4 +8,4 @@
"tracks":[

]
}
}
2 changes: 1 addition & 1 deletion test/data/ws_data/recording.json
Expand Up @@ -629,4 +629,4 @@
],
"length":281000,
"title":"Thinking Out Loud"
}
}
12 changes: 8 additions & 4 deletions test/data/ws_data/release.json
@@ -1,4 +1,11 @@
{
"tags": [
{"name": "test", "count": 5},
{"name": "test2", "count": 3}
],
"user-tags": [
{"name": "test"}
],
"release-group": {
"first-release-date": "1973-03-24",
"artist-credit": [
Expand Down Expand Up @@ -153,9 +160,6 @@
"script": "Latn"
},
"barcode": "123",
"tags": [

],
"relations": [
{
"attributes": [
Expand Down Expand Up @@ -287,4 +291,4 @@
],
"country": "GB",
"status-id": "4e304316-386d-3409-af2e-78857eec5cfe"
}
}
9 changes: 8 additions & 1 deletion test/data/ws_data/release_group.json
@@ -1,5 +1,12 @@
{
"first-release-date":"1973-03-24",
"tags": [
{"name": "test", "count": 5},
{"name": "test2", "count": 3}
],
"user-tags": [
{"name": "test"}
],
"disambiguation":"",
"title":"The Dark Side of the Moon",
"id":"f5093c06-23e3-404f-aeaa-40f72885ee3a",
Expand Down Expand Up @@ -1016,4 +1023,4 @@
}
}
]
}
}
2 changes: 1 addition & 1 deletion test/data/ws_data/track.json
Expand Up @@ -10,4 +10,4 @@
"number":"A1",
"id":"d4156411-b884-368f-a4cb-7c0101a557a2",
"title":"Speak to Me"
}
}
7 changes: 5 additions & 2 deletions test/test_mbjson.py
Expand Up @@ -10,9 +10,9 @@
release_group_to_metadata, country_list_from_node,
media_formats_from_node)
from picard.metadata import Metadata
from picard.releasegroup import ReleaseGroup
from picard.track import Track


settings = {
"standardize_tracks": False,
"standardize_artists": False,
Expand Down Expand Up @@ -56,6 +56,7 @@ def test_release(self):
self.assertEqual(m['~albumartists'], 'Pink Floyd')
self.assertEqual(m['~albumartists_sort'], 'Pink Floyd')
self.assertEqual(m['~releaselanguage'], 'eng')
self.assertEqual(a.folksonomy_tags, {'test2': 3, 'test': 6})

def test_media_formats_from_node(self):
formats = media_formats_from_node(self.json_doc['media'])
Expand Down Expand Up @@ -145,13 +146,15 @@ def setUp(self):

def test_release_group(self):
m = Metadata()
release_group_to_metadata(self.json_doc, m)
r = ReleaseGroup("1")
release_group_to_metadata(self.json_doc, m, r)
self.assertEqual(m['musicbrainz_releasegroupid'], 'f5093c06-23e3-404f-aeaa-40f72885ee3a')
self.assertEqual(m['originaldate'], '1973-03-24')
self.assertEqual(m['originalyear'], '1973')
self.assertEqual(m['releasetype'], 'album')
self.assertEqual(m['~primaryreleasetype'], 'album')
self.assertEqual(m['~releasegroup'], 'The Dark Side of the Moon')
self.assertEqual(r.folksonomy_tags, {'test2': 3, 'test': 6})


class CountryListTest(MBJSONTest):
Expand Down

0 comments on commit 43a33c5

Please sign in to comment.