From c354aeb183f5489f9e3d16fd8c5a90d5e97b755a Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Sun, 28 Apr 2024 14:07:30 +0400 Subject: [PATCH] Fix tests after moving PoolManager to shared module --- backend/test_genius.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/backend/test_genius.py b/backend/test_genius.py index 34ee5d2..d3ea97d 100644 --- a/backend/test_genius.py +++ b/backend/test_genius.py @@ -2,6 +2,7 @@ from unittest import TestCase import urllib3 import genius +import http_pool TITLE = 'A Line In The Sand' @@ -26,17 +27,17 @@ Another day''' class TestGenius(TestCase): def setUp(self) -> None: - self.http = urllib3.PoolManager() + http_pool.get() def test_search_success(self) -> None: - url = genius.search(self.http, TITLE, ARTIST) + url = genius.search(TITLE, ARTIST) self.assertEqual(url, URL) def test_lyrics_parsing(self) -> None: - lyrics = genius.parse(self.http, URL) + lyrics = genius.parse(URL) self.assertTrue(lyrics.startswith(LYR1)) self.assertTrue(LYR2 in lyrics) self.assertTrue(LYR3 in lyrics) def tearDown(self) -> None: - self.http.clear() + http_pool.get().clear()