Skip to content

Commit 461c9cc

Browse files
committed
test: ensure content and content_type are null on errors
1 parent 4202e09 commit 461c9cc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

test/test_http_timeout.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,17 @@ def test_http_get_timeout_reached(sess):
1818
# wait for timeout
1919
time.sleep(7)
2020

21-
(response,timed_out) = sess.execute(
21+
(content_type, content, response,timed_out) = sess.execute(
2222
text(
2323
"""
24-
select error_msg, timed_out from net._http_response where id = :request_id;
24+
select content_type, content, error_msg, timed_out from net._http_response where id = :request_id;
2525
"""
2626
),
2727
{"request_id": request_id},
2828
).fetchone()
2929

30+
assert content_type == None
31+
assert content == None
3032
assert timed_out == True
3133
assert response.startswith("Timeout of 5000 ms reached")
3234

@@ -67,10 +69,10 @@ def test_http_detailed_timeout(sess):
6769
# wait for timeout
6870
time.sleep(2.1)
6971

70-
(response, timed_out) = sess.execute(
72+
(content_type, content, response,timed_out) = sess.execute(
7173
text(
7274
"""
73-
select error_msg, timed_out from net._http_response where id = :request_id;
75+
select content_type, content, error_msg, timed_out from net._http_response where id = :request_id;
7476
"""
7577
),
7678
{"request_id": request_id},
@@ -83,6 +85,8 @@ def test_http_detailed_timeout(sess):
8385
tcp_ssl_time = float(match.group('C'))
8486
http_time = float(match.group('D'))
8587

88+
assert content_type == None
89+
assert content == None
8690
assert timed_out == True
8791
assert total_time > 0
8892
assert dns_time > 0

0 commit comments

Comments
 (0)