Use more helpful asserts, remove redundant

This commit is contained in:
Hugo 2018-01-27 12:59:20 +02:00
parent d1ea097cd7
commit 2703b6b385
5 changed files with 12 additions and 20 deletions

View file

@ -89,7 +89,7 @@ class TestPyLastAlbum(PyLastTestCase):
album2 = pylast.Album("Test Artist", "Test Album", self.network)
# Act / Assert
self.assertFalse(album1 == album2)
self.assertNotEqual(album1, album2)
def test_album_ne_none_is_true(self):
# Arrange
@ -97,7 +97,7 @@ class TestPyLastAlbum(PyLastTestCase):
album2 = pylast.Album("Test Artist", "Test Album", self.network)
# Act / Assert
self.assertTrue(album1 != album2)
self.assertNotEqual(album1, album2)
def test_get_cover_image(self):
# Arrange

View file

@ -251,7 +251,7 @@ class TestPyLastArtist(PyLastTestCase):
# Assert
self.assertIn("https", image)
self.assertGreater(playcount, 1)
self.assertTrue(artist1 != artist2)
self.assertNotEqual(artist1, artist2)
self.assertEqual(name.lower(), name_cap.lower())
self.assertEqual(url, "https://www.last.fm/music/radiohead")
self.assertEqual(mbid, "a74b1b7f-71a5-4011-9441-d0b5e4122711")
@ -263,7 +263,7 @@ class TestPyLastArtist(PyLastTestCase):
artist2 = pylast.Artist("Test Artist", self.network)
# Act / Assert
self.assertFalse(artist1 == artist2)
self.assertNotEqual(artist1, artist2)
def test_artist_ne_none_is_true(self):
# Arrange
@ -271,7 +271,7 @@ class TestPyLastArtist(PyLastTestCase):
artist2 = pylast.Artist("Test Artist", self.network)
# Act / Assert
self.assertTrue(artist1 != artist2)
self.assertNotEqual(artist1, artist2)
def test_artist_get_correction(self):
# Arrange

View file

@ -32,8 +32,8 @@ class TestPyLastCountry(PyLastTestCase):
self.assertIn("Italy", rep)
self.assertIn("pylast.Country", rep)
self.assertEqual(text, "Italy")
self.assertTrue(country1 == country1)
self.assertTrue(country1 != country2)
self.assertEqual(country1, country1)
self.assertNotEqual(country1, country2)
self.assertEqual(url, "https://www.last.fm/place/italy")

View file

@ -54,8 +54,8 @@ class TestPyLastTag(PyLastTestCase):
self.assertIn("pylast.Tag", tag_repr)
self.assertIn("blues", tag_repr)
self.assertEqual("blues", name)
self.assertTrue(tag1 == tag1)
self.assertTrue(tag1 != tag2)
self.assertEqual(tag1, tag1)
self.assertNotEqual(tag1, tag2)
self.assertEqual(url, "https://www.last.fm/tag/blues")

View file

@ -41,16 +41,8 @@ class TestPyLastUser(PyLastTestCase):
# Act / Assert
self.assertEqual(user_1a, user_1b)
self.assertTrue(user_1a == user_1b)
self.assertFalse(user_1a != user_1b)
self.assertNotEqual(user_1a, user_2)
self.assertTrue(user_1a != user_2)
self.assertFalse(user_1a == user_2)
self.assertNotEqual(user_1a, not_a_user)
self.assertTrue(user_1a != not_a_user)
self.assertFalse(user_1a == not_a_user)
def test_get_name(self):
# Arrange
@ -431,7 +423,7 @@ class TestPyLastUser(PyLastTestCase):
track2 = pylast.Track("Test Artist", "test title", self.network)
# Act / Assert
self.assertFalse(track1 == track2)
self.assertNotEqual(track1, track2)
def test_track_ne_none_is_true(self):
# Arrange
@ -439,7 +431,7 @@ class TestPyLastUser(PyLastTestCase):
track2 = pylast.Track("Test Artist", "test title", self.network)
# Act / Assert
self.assertTrue(track1 != track2)
self.assertNotEqual(track1, track2)
def test_track_get_correction(self):
# Arrange
@ -459,7 +451,7 @@ class TestPyLastUser(PyLastTestCase):
mbid = track.get_mbid()
# Assert
self.assertEqual(mbid, None)
self.assertIsNone(mbid)
def test_get_playcount(self):
# Arrange