Skip to content

Commit 1bb4488

Browse files
committed
DE-819 | initial commit
1 parent e44a3e8 commit 1bb4488

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

arango/http.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,11 @@ class DefaultHTTPClient(HTTPClient):
154154
:type pool_timeout: int | float | None
155155
"""
156156

157+
REQUEST_TIMEOUT = DEFAULT_REQUEST_TIMEOUT
158+
157159
def __init__(
158160
self,
159-
request_timeout: Union[int, float, None] = DEFAULT_REQUEST_TIMEOUT,
161+
request_timeout: Union[int, float, None] = REQUEST_TIMEOUT,
160162
retry_attempts: int = 3,
161163
backoff_factor: float = 1.0,
162164
pool_connections: int = 10,

tests/test_client.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,31 @@ def test_client_http_client_attributes(db, username, password):
110110
assert http_client.request_timeout == 80
111111
assert client.request_timeout == http_client.request_timeout
112112

113+
client_no_timeout = ArangoClient(
114+
hosts="http://127.0.0.1:8529", request_timeout=None
115+
)
116+
117+
assert client_no_timeout.request_timeout is None
118+
119+
client_no_timeout = ArangoClient(
120+
hosts="http://127.0.0.1:8529",
121+
http_client=DefaultHTTPClient(request_timeout=None),
122+
)
123+
124+
assert client_no_timeout.request_timeout is None
125+
126+
class NoTimeoutHTTPClient(DefaultHTTPClient):
127+
REQUEST_TIMEOUT = None
128+
129+
def __init__(self, *args, **kwargs):
130+
super().__init__(request_timeout=self.REQUEST_TIMEOUT, *args, **kwargs)
131+
132+
client_no_timeout = ArangoClient(
133+
hosts="http://127.0.0.1:8529", http_client=NoTimeoutHTTPClient()
134+
)
135+
136+
assert client_no_timeout.request_timeout is None
137+
113138

114139
def test_client_custom_http_client(db, username, password):
115140
# Define custom HTTP client which increments the counter on any API call.

0 commit comments

Comments
 (0)