bug 4406 fix v5 (tests pass again)

This commit is contained in:
Luke Harder 2022-11-22 20:40:13 -05:00
parent 4a1f25e1b1
commit f155d3ba75
3 changed files with 4 additions and 2 deletions

View file

@ -234,7 +234,7 @@ class Backend:
def __init__(self, config, log):
self._log = log
self._config = config
self.config = config
@staticmethod
def _encode(s):
@ -517,7 +517,7 @@ class Tekstowo(Backend):
title_dist = string_dist(html_title, title)
artist_dist = string_dist(html_artist, artist)
thresh = self._config['dist_thresh'].get(float)
thresh = self.config['dist_thresh'].get(float)
if title_dist > thresh or artist_dist > thresh:
return None

Binary file not shown.

View file

@ -542,6 +542,7 @@ class TekstowoExtractLyricsTest(TekstowoBaseTest):
"""Set up configuration"""
TekstowoBaseTest.setUp(self)
self.plugin = lyrics.LyricsPlugin()
tekstowo.config = self.plugin.config
def test_good_lyrics(self):
"""Ensure we are able to scrape a page with lyrics"""
@ -605,6 +606,7 @@ class TekstowoIntegrationTest(TekstowoBaseTest, LyricsAssertions):
"""Set up configuration"""
TekstowoBaseTest.setUp(self)
self.plugin = lyrics.LyricsPlugin()
tekstowo.config = self.plugin.config
@unittest.skipUnless(
os.environ.get('INTEGRATION_TEST', '0') == '1',