mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-23 01:16:18 +00:00
Updated getMusicFolders test
This commit is contained in:
parent
fd52a04535
commit
74ce600e03
@ -79,17 +79,9 @@ class BrowseTestCase(ApiTestBase):
|
|||||||
def test_get_music_folders(self):
|
def test_get_music_folders(self):
|
||||||
# Do not validate against the XSD here, this is the only place where the API should return ids as ints
|
# Do not validate against the XSD here, this is the only place where the API should return ids as ints
|
||||||
# all our ids are uuids :/
|
# all our ids are uuids :/
|
||||||
rv = self.client.get('/rest/getMusicFolders.view', query_string = { 'u': 'alice', 'p': 'Alic3', 'c': 'tests' })
|
rv, child = self._make_request('getMusicFolders', tag = 'musicFolders', skip_xsd = True)
|
||||||
self.assertEqual(rv.status_code, 200)
|
self.assertEqual(len(child), 2)
|
||||||
xml = etree.fromstring(rv.data)
|
self.assertSequenceEqual(sorted(self._xpath(child, './musicFolder/@name')), [ 'Empty root', 'Root folder' ])
|
||||||
|
|
||||||
NS = '{http://subsonic.org/restapi}'
|
|
||||||
self.assertEqual(xml.tag, NS + 'subsonic-response')
|
|
||||||
self.assertEqual(xml.get('status'), 'ok')
|
|
||||||
self.assertEqual(len(xml), 1)
|
|
||||||
self.assertEqual(xml[0].tag, NS + 'musicFolders')
|
|
||||||
self.assertEqual(len(xml[0]), 2)
|
|
||||||
self.assertSequenceEqual(sorted(self._xpath(xml, './musicFolders/musicFolder/@name')), [ 'Empty root', 'Root folder' ])
|
|
||||||
|
|
||||||
def test_get_indexes(self):
|
def test_get_indexes(self):
|
||||||
self._make_request('getIndexes', { 'musicFolderId': 'abcdef' }, error = 0)
|
self._make_request('getIndexes', { 'musicFolderId': 'abcdef' }, error = 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user