Skip to content

Commit

Permalink
remove prints
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenifer Tabita Ciuciu-Kiss committed Oct 16, 2024
1 parent 7d4d3a9 commit de9b6cd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
3 changes: 1 addition & 2 deletions ontologytimemachine/utils/download_archivo_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 2 additions & 7 deletions ontologytimemachine/utils/proxy_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 2 additions & 3 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 0 additions & 2 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit de9b6cd

Please sign in to comment.