Support authentication tokens to construct networks

Closes #193
This commit is contained in:
Jace Browning 2017-01-31 15:00:38 -05:00
parent 7b3ab250df
commit 80f391761c
3 changed files with 36 additions and 10 deletions

View file

@ -2160,6 +2160,20 @@ class TestPyLast(unittest.TestCase):
# Assert
self.assertEqual(mbid, None)
def test_init_with_token(self):
# Arrange/Act
try:
pylast.LastFMNetwork(
api_key=self.__class__.secrets["api_key"],
api_secret=self.__class__.secrets["api_secret"],
token="invalid",
)
except pylast.WSError as exc:
msg = str(exc)
# Assert
self.assertEqual(msg, "Invalid authentication token supplied")
@flaky(max_runs=5, min_passes=1)
class TestPyLastWithLibreFm(unittest.TestCase):