Fix minor things from code inspection

This commit is contained in:
hugovk 2017-10-24 00:54:34 +03:00
parent 3a7cc9c410
commit c601d2f365
4 changed files with 9 additions and 7 deletions

View file

@ -244,7 +244,7 @@ class _Network(object):
"""
Returns an (API_KEY, API_SECRET, SESSION_KEY) tuple.
"""
return (self.api_key, self.api_secret, self.session_key)
return self.api_key, self.api_secret, self.session_key
def _delay_call(self):
"""

View file

@ -8,8 +8,8 @@ setup(
author="Amr Hassan <amr.hassan@gmail.com>",
install_requires=['six'],
tests_require=['mock', 'pytest', 'coverage', 'pycodestyle', 'pyyaml',
'pyflakes'],
description=("A Python interface to Last.fm and Libre.fm"),
'pyflakes', 'flaky'],
description="A Python interface to Last.fm and Libre.fm",
author_email="amr.hassan@gmail.com",
url="https://github.com/pylast/pylast",
classifiers=[

View file

@ -174,7 +174,7 @@ class TestPyLastNetwork(PyLastTestCase):
# Act
stringed = str(thing)
repr = thing.__repr__()
rep = thing.__repr__()
title = thing.get_title()
name = thing.get_name()
playcount = thing.get_playcount()
@ -182,7 +182,7 @@ class TestPyLastNetwork(PyLastTestCase):
# Assert
self.assertEqual(stringed, "Test Artist - Test Album")
self.assertIn("pylast.Album('Test Artist', 'Test Album',", repr)
self.assertIn("pylast.Album('Test Artist', 'Test Album',", rep)
self.assertEqual(title, name)
self.assertIsInstance(playcount, int)
self.assertGreater(playcount, 1)
@ -195,7 +195,7 @@ class TestPyLastNetwork(PyLastTestCase):
# Act
stringed = str(thing)
repr = thing.__repr__()
rep = thing.__repr__()
title = thing.get_title()
name = thing.get_name()
playcount = thing.get_playcount()
@ -203,7 +203,7 @@ class TestPyLastNetwork(PyLastTestCase):
# Assert
self.assertEqual(stringed, "Test Artist - test title")
self.assertIn("pylast.Track('Test Artist', 'test title',", repr)
self.assertIn("pylast.Track('Test Artist', 'test title',", rep)
self.assertEqual(title, "test title")
self.assertEqual(title, name)
self.assertIsInstance(playcount, int)
@ -275,6 +275,7 @@ class TestPyLastNetwork(PyLastTestCase):
def test_init_with_token(self):
# Arrange/Act
msg = None
try:
pylast.LastFMNetwork(
api_key=self.__class__.secrets["api_key"],

View file

@ -239,6 +239,7 @@ class TestPyLastUser(PyLastTestCase):
def helper_get_assert_charts(self, thing, date):
# Arrange
album_chart, track_chart = None, None
(from_date, to_date) = date
# Act