Adapt dataservices-api server to python3
Related to https://github.com/CartoDB/cartodb-platform/issues/6237
This commit is contained in:
@@ -20,7 +20,7 @@ class ImportHelper:
|
||||
response.raise_for_status()
|
||||
response_json = json.loads(response.text)
|
||||
if not response_json['success']:
|
||||
print "Error importing the test dataset: {0}".format(response.text)
|
||||
print("Error importing the test dataset: {0}".format(response.text))
|
||||
sys.exit(1)
|
||||
while(True):
|
||||
table_name = ImportHelper.get_imported_table_name(
|
||||
@@ -42,8 +42,8 @@ class ImportHelper:
|
||||
schema, username, host, import_id, api_key)
|
||||
import_data_response = requests.get(import_url)
|
||||
if import_data_response.status_code != 200:
|
||||
print "Error getting the table name from " \
|
||||
"the import data: {0}".format(import_data_response.text)
|
||||
print("Error getting the table name from " \
|
||||
"the import data: {0}".format(import_data_response.text))
|
||||
sys.exit(1)
|
||||
import_data_json = json.loads(import_data_response.text)
|
||||
|
||||
@@ -57,5 +57,5 @@ class ImportHelper:
|
||||
)
|
||||
response = requests.get(url)
|
||||
if response.status_code != 200:
|
||||
print "Error cleaning the test dataset: {0}".format(response.text)
|
||||
print("Error cleaning the test dataset: {0}".format(response.text))
|
||||
sys.exit(1)
|
||||
|
||||
@@ -48,7 +48,7 @@ class IntegrationTestHelper:
|
||||
def execute_query_raw(cls, sql_api_url, query):
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
query_url = "{0}?q={1}".format(sql_api_url, query)
|
||||
print "Executing query: {0}".format(query_url)
|
||||
print("Executing query: {0}".format(query_url))
|
||||
query_response = requests.get(query_url)
|
||||
if query_response.status_code != 200:
|
||||
raise Exception(json.loads(query_response.text)['error'])
|
||||
|
||||
Reference in New Issue
Block a user