Skip to content

Commit

Permalink
fix broken testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenifer Tabita Ciuciu-Kiss committed Oct 21, 2024
1 parent ef8bbc6 commit df622db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ontologytimemachine/custom_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
default_cfg: Config = Config()
config = None

IP = default_cfg.port
PORT = default_cfg.host
IP = default_cfg.host
PORT = default_cfg.port


class OntologyTimeMachinePlugin(HttpProxyBasePlugin):
Expand Down
21 changes: 13 additions & 8 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
import time
import subprocess
import itertools
from ontologytimemachine.utils.config import Config
from ontologytimemachine.custom_proxy import IP, PORT


default_cfg: Config = Config()

IP = default_cfg.port
PORT = default_cfg.host

PROXY = f"{IP}:{PORT}"
HTTP_PROXY = f"http://{PROXY}"
HTTPS_PROXY = f"http://{PROXY}"
Expand Down Expand Up @@ -116,14 +111,24 @@ def test_15_linked_web_apis():


def generic_test(iri, content_type):
response = requests.get(iri, proxies=PROXIES, verify=CA_CERT_PATH)
response = requests.get(
iri,
proxies=PROXIES,
verify=CA_CERT_PATH,
auth=HTTPBasicAuth("admin", "archivo"),
)
assert response.status_code == 200
assert iri in response.content.decode("utf-8")


def iri_generic_test(iri):
try:
response = requests.get(iri, proxies=PROXIES, verify=CA_CERT_PATH)
response = requests.get(
iri,
proxies=PROXIES,
verify=CA_CERT_PATH,
auth=HTTPBasicAuth("admin", "archivo"),
)
assert response.status_code == 200
assert iri in response.content.decode("utf-8")
except AssertionError:
Expand Down

0 comments on commit df622db

Please sign in to comment.