From 67e0af526c1e250eb7cdba88d6ae176d6fad9fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Wed, 2 Oct 2024 20:42:04 +0100 Subject: [PATCH] Remove outdated GeniusLyrics test The test for GeniusLyrics was heavily patched and no longer provided useful coverage. It has been removed to clean up the test suite. --- test/plugins/test_lyrics.py | 47 ------------------------------------- 1 file changed, 47 deletions(-) diff --git a/test/plugins/test_lyrics.py b/test/plugins/test_lyrics.py index 04b8e667b..8f952b74b 100644 --- a/test/plugins/test_lyrics.py +++ b/test/plugins/test_lyrics.py @@ -18,7 +18,6 @@ import itertools import os import unittest from functools import partial -from unittest.mock import patch import pytest @@ -342,52 +341,6 @@ class TestGeniusLyrics(LyricsBackendTest): assert len(result.splitlines()) == expected_line_count - @patch.object(lyrics.Genius, "_scrape_lyrics_from_html") - @patch.object(lyrics.Backend, "fetch_url", return_value=True) - def test_json(self, mock_fetch_url, mock_scrape, backend): - """Ensure we're finding artist matches""" - with patch.object( - lyrics.Genius, - "_search", - return_value={ - "response": { - "hits": [ - { - "result": { - "primary_artist": { - "name": "\u200bblackbear", - }, - "url": "blackbear_url", - } - }, - { - "result": { - "primary_artist": {"name": "El\u002dp"}, - "url": "El-p_url", - } - }, - ] - } - }, - ) as mock_json: - # genius uses zero-width-spaces (\u200B) for lowercase - # artists so we make sure we can match those - assert backend.fetch("blackbear", "Idfc") is not None - mock_fetch_url.assert_called_once_with("blackbear_url") - mock_scrape.assert_called_once_with(True) - - # genius uses the hyphen minus (\u002D) as their dash - assert backend.fetch("El-p", "Idfc") is not None - mock_fetch_url.assert_called_with("El-p_url") - mock_scrape.assert_called_with(True) - - # test no matching artist - assert backend.fetch("doesntexist", "none") is None - - # test invalid json - mock_json.return_value = None - assert backend.fetch("blackbear", "Idfc") is None - class TestTekstowoLyrics(LyricsBackendTest): @pytest.fixture(scope="class")