Exemplo n.º 1
0
 def test_nominal(self):
     """Verify a normal song can be parsed."""
     song = Song("Artist", "Title", "Album", 2000, 7, 123)
     self.assertEqual(Artist("Artist"), song.artist)
     self.assertEqual(Title("Title"), song.title)
     self.assertEqual(Album("Album"), song.album)
     self.assertEqual(7, song.track)
     self.assertEqual(123, song.duration)
Exemplo n.º 2
0
 def test_live(self):
     """Verify a live song does not match."""
     self.assertNotEqual(Song("Artist", "Title"),
                         Song("Artist", "Title (live)"))
Exemplo n.º 3
0
 def test_types(self):
     """Verify different types are not equal."""
     self.assertNotEqual(Song("Artist", "Title"), "Artist - Title")
Exemplo n.º 4
0
 def test_title_articles(self):
     """Verify song titles with missing articles are matched."""
     self.assertEqual(Song("Artist", "The Song Name"),
                      Song("Artist", "Song Name"))
Exemplo n.º 5
0
 def test_remixes(self):
     """Verify similarly labeled remixes are equal."""
     self.assertEqual(Song("Artist", "Title (remix)"),
                      Song("Artist", "Title [Remix]"))
Exemplo n.º 6
0
 def test_case(self):
     """Verify case does not matter."""
     self.assertEqual(Song("Artist", "Title"), Song("artist", "title"))
Exemplo n.º 7
0
 def test_exact(self):
     """Verify exact matches are equal."""
     self.assertEqual(Song("Artist", "Title"), Song("Artist", "Title"))
Exemplo n.º 8
0
 def test_errors(self):
     """Verify parsing errors are handled."""
     self.assertEqual(None, Song("A", "T", track=None).track)
     self.assertEqual(None, Song("A", "T", track="Year").track)