diff --git a/ontologytimemachine/utils/download_archivo_urls.py b/ontologytimemachine/utils/download_archivo_urls.py index ed3065c..030fff5 100644 --- a/ontologytimemachine/utils/download_archivo_urls.py +++ b/ontologytimemachine/utils/download_archivo_urls.py @@ -83,8 +83,7 @@ def download_archivo_urls(): csv_reader = csv.reader(csv_file, delimiter=",") with open(ARCHIVO_FILE_PATH, "w") as txt_file: for row in csv_reader: - if row: # Ensure row is not empty - print(row) + if row: txt_file.write( row[0].strip() + "\n" ) # Write only the first column (URL) to the text file diff --git a/ontologytimemachine/utils/proxy_logic.py b/ontologytimemachine/utils/proxy_logic.py index c479547..3fc3eb3 100644 --- a/ontologytimemachine/utils/proxy_logic.py +++ b/ontologytimemachine/utils/proxy_logic.py @@ -34,7 +34,6 @@ def if_intercept_host(config): def do_deny_request_due_non_archivo_ontology_uri(wrapped_request, only_ontologies): if only_ontologies: - print(only_ontologies) is_archivo_ontology = is_archivo_ontology_request(wrapped_request) if not is_archivo_ontology: return True @@ -66,11 +65,7 @@ def is_archivo_ontology_request(wrapped_request): # Extract the request's host and path request_host = wrapped_request.get_request_host() request_path = wrapped_request.get_request_path() - - print(f"Host: {request_host}") - print(f"Path: {request_path}") - print((request_host, request_path)) - print(list(ARCHIVO_PARSED_URLS)[0]) + if (request_host, request_path) in ARCHIVO_PARSED_URLS: logger.info(f"Requested URL: {request_host+request_path} is in Archivo") return True @@ -86,7 +81,7 @@ def is_archivo_ontology_request(wrapped_request): path_parts = request_path.split("/") new_path = "/".join(path_parts[:-1]) - print(f"New path: {new_path}") + if (request_host, new_path) in ARCHIVO_PARSED_URLS: logger.info(f"Requested URL: {request_host+request_path} is in Archivo") return True diff --git a/tests/test_integration.py b/tests/test_integration.py index 472fa3d..f33e088 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -120,11 +120,10 @@ def iri_generic_test(iri): response = requests.get(iri, proxies=PROXIES, verify=CA_CERT_PATH) assert response.status_code == 200 assert iri in response.content.decode("utf-8") - print(f"Test passed for IRI: {iri}") except AssertionError: - print(f"Test failed for IRI: {iri}") + return e except requests.exceptions.RequestException as e: - print(f"Request failed for IRI: {iri}, Error: {e}") + return e def get_parameter_combinations(): diff --git a/tests/test_utils.py b/tests/test_utils.py index 60cc702..fb0ca0a 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -56,8 +56,6 @@ def test_parse_accept_header_with_priority(self): ("application/xml", 0.9), ("*/*", 0.8), ] - print(parsed_result) - print(expected_result) self.assertEqual(parsed_result, expected_result) def test_get_format_from_accept_header(self):