Shorten test names
This commit is contained in:
parent
6fd84421bd
commit
36f7e9619b
9 changed files with 0 additions and 0 deletions
63
tests/test_tag.py
Executable file
63
tests/test_tag.py
Executable file
|
@ -0,0 +1,63 @@
|
|||
#!/usr/bin/env python
|
||||
"""
|
||||
Integration (not unit) tests for pylast.py
|
||||
"""
|
||||
import unittest
|
||||
|
||||
import pylast
|
||||
|
||||
from .test_pylast import PyLastTestCase
|
||||
|
||||
|
||||
class TestPyLastTag(PyLastTestCase):
|
||||
|
||||
def test_tag_is_hashable(self):
|
||||
# Arrange
|
||||
tag = self.network.get_top_tags(limit=1)[0]
|
||||
|
||||
# Act/Assert
|
||||
self.helper_is_thing_hashable(tag)
|
||||
|
||||
def test_tag_top_artists(self):
|
||||
# Arrange
|
||||
tag = self.network.get_tag("blues")
|
||||
|
||||
# Act
|
||||
artists = tag.get_top_artists(limit=1)
|
||||
|
||||
# Assert
|
||||
self.helper_only_one_thing_in_top_list(artists, pylast.Artist)
|
||||
|
||||
def test_tag_top_albums(self):
|
||||
# Arrange
|
||||
tag = self.network.get_tag("blues")
|
||||
|
||||
# Act
|
||||
albums = tag.get_top_albums(limit=1)
|
||||
|
||||
# Assert
|
||||
self.helper_only_one_thing_in_top_list(albums, pylast.Album)
|
||||
|
||||
def test_tags(self):
|
||||
# Arrange
|
||||
tag1 = self.network.get_tag("blues")
|
||||
tag2 = self.network.get_tag("rock")
|
||||
|
||||
# Act
|
||||
tag_repr = repr(tag1)
|
||||
tag_str = str(tag1)
|
||||
name = tag1.get_name(properly_capitalized=True)
|
||||
url = tag1.get_url()
|
||||
|
||||
# Assert
|
||||
self.assertEqual("blues", tag_str)
|
||||
self.assertIn("pylast.Tag", tag_repr)
|
||||
self.assertIn("blues", tag_repr)
|
||||
self.assertEqual("blues", name)
|
||||
self.assertEqual(tag1, tag1)
|
||||
self.assertNotEqual(tag1, tag2)
|
||||
self.assertEqual(url, "https://www.last.fm/tag/blues")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main(failfast=True)
|
Loading…
Add table
Add a link
Reference in a new issue