async def test_playlist_exit_fm_mode(app_mock, song, mocker): mocker.patch.object(Playlist, 'a_set_current_song') pl = Playlist(app_mock) pl.mode = PlaylistMode.fm pl.current_song = song assert pl.mode is PlaylistMode.normal assert app_mock.task_mgr.get_or_create.called
async def test_playlist_exit_fm_mode(app_mock, song, mocker, mock_a_set_cursong): pl = Playlist(app_mock) pl.mode = PlaylistMode.fm pl.current_song = song assert pl.mode is PlaylistMode.normal assert app_mock.task_mgr.get_or_create.called
async def test_playlist_fm_mode_play_previous(app_mock, song, song1, mocker): pl = Playlist(app_mock) pl.mode = PlaylistMode.fm pl.fm_add(song1) pl.fm_add(song) pl._current_song = song pl.current_song = song1 # should not exit fm mode assert pl.mode is PlaylistMode.fm
async def test_playlist_fm_mode_play_next(app_mock, song, song1, mocker): mocker.patch.object(Playlist, 'a_set_current_song') pl = Playlist(app_mock) pl.mode = PlaylistMode.fm pl.fm_add(song1) pl.fm_add(song) pl._current_song = song1 pl.current_song = song # should not exit fm mode assert pl.mode is PlaylistMode.fm
async def test_playlist_fm_mode_play_next(app_mock, song, song1, mock_a_set_cursong): pl = Playlist(app_mock) pl.mode = PlaylistMode.fm pl.fm_add(song1) pl.fm_add(song) pl._current_song = song1 pl.current_song = song # should not exit fm mode assert pl.mode is PlaylistMode.fm