Fix running apps

This commit is contained in:
Kyle Robbertze 2020-01-22 13:54:04 +02:00
parent e8a0783139
commit 5923dee839
6 changed files with 3 additions and 63 deletions

View file

@ -122,7 +122,7 @@ class ApiRequest(object):
try:
req = urllib.request.Request(final_url, _post_data)
f = urllib.request.urlopen(req, timeout=ApiRequest.API_HTTP_REQUEST_TIMEOUT)
content_type = f.info().getheader('Content-Type')
content_type = f.info().get_content_type()
response = f.read()
#Everything that calls an ApiRequest should be catching URLError explicitly
#(according to the other comments in this file and a cursory grep through the code)

View file

@ -4,7 +4,7 @@ from mock import MagicMock, patch
from api_clients.api_client import ApcUrl, ApiRequest
class ResponseInfo:
def getheader(self, name):
def get_content_type(self):
return 'application/json'
class TestApiRequest(unittest.TestCase):