Fixes broadcast tests

This commit is contained in:
Mouse Reeve
2020-11-29 09:40:15 -08:00
parent e9be31e9c1
commit 9ddd60ce16
4 changed files with 28 additions and 22 deletions

View File

@ -1,3 +1,4 @@
''' bring connectors into the namespace '''
from .settings import CONNECTORS
from .abstract_connector import ConnectorException
from .abstract_connector import get_data, get_image

View File

@ -318,6 +318,17 @@ def get_data(url):
return data
def get_image(url):
''' wrapper for requesting an image '''
try:
resp = requests.get(url)
except RequestError:
return None
if not resp.ok:
return None
return resp
@dataclass
class SearchResult:
''' standardized search result object '''