Skip to content

Commit d4f0c51

Browse files
committed
fix-port
1 parent dd2cb69 commit d4f0c51

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

terminusdb_client/tests/integration_tests/conftest.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,35 @@
1212
def is_local_server_running():
1313
"""Check if local TerminusDB server is running at http://127.0.0.1:6363"""
1414
try:
15-
response = requests.get("http://127.0.0.1:6363", timeout=2)
16-
# Server responds with 200 (success) or 404 (not found but server is up)
17-
# 401 (unauthorized) also indicates server is running but needs auth
18-
return response.status_code in [200, 404]
15+
response = requests.get(
16+
"http://127.0.0.1:6363", timeout=2, allow_redirects=False
17+
)
18+
# Any HTTP response means the server is running
19+
return response.status_code in [200, 302, 401, 404]
1920
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
2021
return False
2122

2223

2324
def is_docker_server_running():
2425
"""Check if Docker TerminusDB server is already running at http://127.0.0.1:6366"""
2526
try:
26-
response = requests.get("http://127.0.0.1:6366", timeout=2)
27-
# Server responds with 404 for root path, which means it's running
28-
return response.status_code in [200, 404]
27+
response = requests.get(
28+
"http://127.0.0.1:6366", timeout=2, allow_redirects=False
29+
)
30+
# Any HTTP response means the server is running
31+
return response.status_code in [200, 302, 401, 404]
2932
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
3033
return False
3134

3235

3336
def is_jwt_server_running():
3437
"""Check if JWT Docker TerminusDB server is already running at http://127.0.0.1:6367"""
3538
try:
36-
response = requests.get("http://127.0.0.1:6367", timeout=2)
37-
# Server responds with 404 for root path, which means it's running
38-
return response.status_code in [200, 404]
39+
response = requests.get(
40+
"http://127.0.0.1:6367", timeout=2, allow_redirects=False
41+
)
42+
# Any HTTP response means the server is running
43+
return response.status_code in [200, 302, 401, 404]
3944
except (requests.exceptions.ConnectionError, requests.exceptions.Timeout):
4045
return False
4146

0 commit comments

Comments
 (0)