def test_on_logged_in_event_adds_playlist_moved_handler(spotify_mock, config): session_mock = spotify_mock.Session.return_value backend = get_backend(config, session_mock) backend.on_logged_in() assert (mock.call(spotify_mock.PlaylistContainerEvent.PLAYLIST_MOVED, playlists.on_playlist_moved) in session_mock.playlist_container.on.call_args_list)
def test_on_logged_in_event_adds_playlist_moved_handler( spotify_mock, config): session_mock = spotify_mock.Session.return_value backend = get_backend(config, session_mock) backend.on_logged_in() assert (mock.call( spotify_mock.PlaylistContainerEvent.PLAYLIST_MOVED, playlists.on_playlist_moved) in session_mock.playlist_container.on.call_args_list)
def test_on_logged_in_event_activates_private_session( spotify_mock, config, caplog): session_mock = spotify_mock.Session.return_value private_session_mock = mock.PropertyMock() type(session_mock.social).private_session = private_session_mock config['spotify']['private_session'] = True backend = get_backend(config, session_mock) backend.on_logged_in() assert 'Spotify private session activated' in caplog.text() private_session_mock.assert_called_once_with(True)