Split test into passing and failing tests

This commit is contained in:
hugovk 2016-04-23 15:27:28 +03:00
parent 8195725500
commit 4c8d2e2a9b

View file

@ -210,6 +210,10 @@ class TestPyLast(unittest.TestCase):
registered = user.get_registered()
# Assert
# Last.fm API broken? Should be yyyy-mm-dd not Unix timestamp
if int(registered):
pytest.skip("Last.fm API is broken.")
# Just check date because of timezones
self.assertIn(u"2002-11-20 ", registered)
@ -1912,7 +1916,6 @@ class TestPyLast(unittest.TestCase):
tag_repr = repr(tag1)
tag_str = str(tag1)
name = tag1.get_name(properly_capitalized=True)
similar = tag1.get_similar()
url = tag1.get_url()
# Assert
@ -1923,6 +1926,16 @@ class TestPyLast(unittest.TestCase):
self.assertTrue(tag1 == tag1)
self.assertTrue(tag1 != tag2)
self.assertEqual(url, "http://www.last.fm/tag/blues")
@handle_lastfm_exceptions
def test_tags_similar(self):
# Arrange
tag = self.network.get_tag("blues")
# Act
similar = tag.get_similar()
# Assert
found = False
for tag in similar:
if tag.name == "delta blues":