Fix tests after moving PoolManager to shared module
This commit is contained in:
parent
ab93124337
commit
c354aeb183
1 changed files with 5 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue