Ejemplo n.º 1
0
 def test_playlist(self):
     barrel = BarrelOfMonkeys()
     first_song = barrel.first_song()
     playlist = barrel.playlist(first_song, 10)
     # Starts at the second song
     for song in playlist[1:]:
         last_char = first_song[-1].upper()
         first_song = song
         self.assertEqual(last_char,
                          first_song[0].upper())
Ejemplo n.º 2
0
 def test_get_xml_returns_a_string(self):
     barrel = BarrelOfMonkeys()
     self.assertEqual(type(barrel.get_xml()), str)
Ejemplo n.º 3
0
 def test_first_song_returns_the_first_song(self):
     barrel = BarrelOfMonkeys()
     first_song = barrel.first_song()
     self.assertEqual(first_song, 'Caught Up In You')
Ejemplo n.º 4
0
 def test_next_song_starts_with_last_letter(self):
     barrel = BarrelOfMonkeys()
     first_song = barrel.first_song()
     second_song = barrel.next_song(first_song)
     self.assertEqual(first_song[-1].lower(),
                      second_song[0].lower())
Ejemplo n.º 5
0
 def test_parse_returns_a_list(self):
     barrel = BarrelOfMonkeys()
     xml = barrel.get_xml()
     self.assertEqual(type(barrel.parse(xml)), list)