mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-25 10:48:18 +00:00
Move few functions to new webservice.utils and introduce set_minimum_delay_for_url()
- it limits the need to import hostkey_from_url() - it reduces the size of webservice.py - it reduces dependencies between files
This commit is contained in:
@@ -44,10 +44,12 @@ from picard.webservice import (
|
||||
UnknownResponseParserError,
|
||||
WebService,
|
||||
WSRequest,
|
||||
ratecontrol,
|
||||
)
|
||||
from picard.webservice.utils import (
|
||||
host_port_to_url,
|
||||
hostkey_from_url,
|
||||
port_from_qurl,
|
||||
ratecontrol,
|
||||
)
|
||||
|
||||
|
||||
@@ -536,7 +538,7 @@ class WSRequestTest(PicardTestCase):
|
||||
self.assertEqual(request.url().toString(), 'http://example.org/path?a=1&a=2&b=x x&c=1+2&d=%26&e=?')
|
||||
|
||||
|
||||
class MiscWebServiceTest(PicardTestCase):
|
||||
class WebServiceUtilsTest(PicardTestCase):
|
||||
|
||||
def test_port_from_qurl_http(self):
|
||||
self.assertEqual(port_from_qurl(QUrl('http://example.org')), 80)
|
||||
|
||||
Reference in New Issue
Block a user