mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 00:46:18 +00:00
Move a ListenBrainz test to the net suite
Allow to uncomment it and slightly improves coverage
This commit is contained in:
parent
8d3a31d012
commit
1cfca94109
@ -255,18 +255,6 @@ class UserTestCase(FrontendTestBase):
|
||||
rv = self.client.get("/user/me/lastfm/unlink", follow_redirects=True)
|
||||
self.assertIn("Unlinked", rv.data)
|
||||
|
||||
def test_listenbrainz_link(self):
|
||||
self._login("alice", "Alic3")
|
||||
rv = self.client.get("/user/me/listenbrainz/link", follow_redirects=True)
|
||||
self.assertIn("Missing ListenBrainz auth token", rv.data)
|
||||
# # Testing this requires an HTTP request!
|
||||
# rv = self.client.get(
|
||||
# "/user/me/listenbrainz/link",
|
||||
# query_string={"token": "abcdef"},
|
||||
# follow_redirects=True,
|
||||
# )
|
||||
# self.assertIn("Error: ", rv.data)
|
||||
|
||||
def test_listenbrainz_unlink(self):
|
||||
self._login("alice", "Alic3")
|
||||
rv = self.client.get("/user/me/listenbrainz/unlink", follow_redirects=True)
|
||||
|
@ -11,6 +11,8 @@ import unittest
|
||||
|
||||
from supysonic.listenbrainz import ListenBrainz
|
||||
|
||||
from ..frontend.frontendtestbase import FrontendTestBase
|
||||
|
||||
class ListenBrainzTestCase(unittest.TestCase):
|
||||
"""Basic test of unauthenticated ListenBrainz API method"""
|
||||
|
||||
@ -22,5 +24,18 @@ class ListenBrainzTestCase(unittest.TestCase):
|
||||
rv = listenbrainz._ListenBrainz__api_request(False, "/1/search/users/?search_term={0}".format(user), token="123")
|
||||
self.assertIsInstance(rv, dict)
|
||||
|
||||
class FrontendListenBrainzCase(FrontendTestBase):
|
||||
def test_listenbrainz_link(self):
|
||||
self._login("alice", "Alic3")
|
||||
rv = self.client.get("/user/me/listenbrainz/link", follow_redirects=True)
|
||||
self.assertIn("Missing ListenBrainz auth token", rv.data)
|
||||
rv = self.client.get(
|
||||
"/user/me/listenbrainz/link",
|
||||
query_string={"token": "abcdef"},
|
||||
follow_redirects=True,
|
||||
)
|
||||
self.assertIn("Error: ", rv.data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
Loading…
Reference in New Issue
Block a user