From 74ce600e035b445c251c0a9e36a75ff48f3c90a4 Mon Sep 17 00:00:00 2001 From: spl0k Date: Fri, 17 Nov 2017 20:00:26 +0100 Subject: [PATCH] Updated getMusicFolders test --- tests/api/test_browse.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/tests/api/test_browse.py b/tests/api/test_browse.py index 17d1826..e026a0b 100644 --- a/tests/api/test_browse.py +++ b/tests/api/test_browse.py @@ -79,17 +79,9 @@ class BrowseTestCase(ApiTestBase): 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 # all our ids are uuids :/ - rv = self.client.get('/rest/getMusicFolders.view', query_string = { 'u': 'alice', 'p': 'Alic3', 'c': 'tests' }) - self.assertEqual(rv.status_code, 200) - xml = etree.fromstring(rv.data) - - 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' ]) + rv, child = self._make_request('getMusicFolders', tag = 'musicFolders', skip_xsd = True) + self.assertEqual(len(child), 2) + self.assertSequenceEqual(sorted(self._xpath(child, './musicFolder/@name')), [ 'Empty root', 'Root folder' ]) def test_get_indexes(self): self._make_request('getIndexes', { 'musicFolderId': 'abcdef' }, error = 0)