def test_init_playlist(self): with self.subTest("test init"): Playlist(name="Test_Playlist") with self.subTest("test init"): Playlist(name="Test_Playlist", repeat=True) with self.subTest("test init"): Playlist(name="Test_Playlist", shuffle=True) with self.subTest("test init"): Playlist(name="Test_Playlist", repeat=True, shuffle=True)
def setUp(self): self.one = Song("bbb", "aaa", "ccc", "3:36") self.two = Song("ddd", "aaa", "eee", "4:20") self.three = Song("eee", "aaa", "ccc", "12:28") self.four = Song("nnn", "mmm", "ooo", "6:32") self.five = Song("sss", "ppp", "rrr", "1:20:03") self.six = Song("yyy", "xxx", "zzz", "2:32:15") self.playlist_one = Playlist(name="First") self.playlist_two = Playlist(name="First", repeat=True) self.playlist_three = Playlist(name="First", shuffle=True) self.playlist_four = Playlist(name="First", repeat=True, shuffle=True) self.list_of_songs = [ self.one, self.two, self.three, self.four, self.five, self.six ]
def main(): p = Playlist(name='za ceniteli') p.add_songs([ Song(title='Domination', artist='Pantera', album='Cowboys From Hell', length='05:04'), Song(title='This Love', artist='Pantera', album='Vulgar display of power', length='04:54'), Song(title='Walk', artist='Pantera', album='Vulgar display of power', length='03:54'), Song(title='Momicheto', artist='Hipodil', album='Nadurveni vuglishta', length='03:09') ]) p.pprint_playlist() p.save() print('*' * 50) p = Playlist.load('za-ceniteli.json') p.add_songs([ Song(title='Vurtianalen SEX', artist='Hipodil', album='Nadurveni vuglishta', length='04:04'), Song(title='Kolio Piqndeto', artist='Obraten Efekt', album='Efekten Obrat', length='03:31'), Song(title='Polet', artist='Obraten Efekt', album='Vervaite ni', length='03:50'), Song(title='Choki', artist='Obraten Efekt', album='Vervaite ni', length='04:09') ]) p.pprint_playlist() p.save()
def __init__(self): # APPLICATION VARIABLES self._volume = 100 self._cur_time = 0 self._max_time = 0 self._repeat = False # PLAYLIST self.playlist = Playlist() # GUI self.qapp = QApplication([]) self.mainwindow = MainWindow(self) # MUSIC PLAYER self.player = MusicPlayer(self)
def setUp(self): self.song1 = Song( title="Bullet with Butterfly Wings", artist="Smashing Pumpkins", time='00:04:17' ) self.song2 = Song( title="Song 2", artist="Blur", time="00:02:01" ) self.song3 = Song( title="Creep", artist="Radiohead", time="00:03:58" ) self.playlist = Playlist( [self.song1, self.song2, self.song3] )
from music import Playlist if __name__ == '__main__': arvoreMusical = Playlist('Lonely', 2004, 'Trouble', 1) m1 = Playlist('Batom cereja', 2021, 'Aqui e agora', 2) m2 = Playlist('Foi pá pum', 2020, 'Debaixo do meu telhado', 3) m3 = Playlist('Laços de familia', 2004, 'Alma gêmea', 4) arvoreMusical.inserir(m1) arvoreMusical.inserir(m2) arvoreMusical.inserir(m3) arvoreMusical.display() arvoreMusical.em_ordem(arvoreMusical) print() # def imprimeMenu(): # print(f''' # Music # | [1] Cadastrar Nova Playlist | # | [2] Acrescentar Música | # | [3] Buscar Música por ID | # | [4] Exibir Maior e Menor Idade | # | [5] Ordernar Surfistas Por Nome | # | [6] Exibir Surfistas Cadastrados | # | [7] Mostrar Quantidade de Surfitas | # | [8] Remover um Surfista |
def test_play_next_song_when_empty(self): playlist2 = Playlist() with self.assertRaises(IndexError): playlist2.play_next_song()