Skip to content

Commit fae9f17

Browse files
committed
fix(tests): fixed build for python 3.7.15 and Ubuntu 20.04.1
1 parent 8eb25b5 commit fae9f17

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tests/test_InfluxDBClient.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -407,14 +407,28 @@ def test_custom_debug_logging_handler(self):
407407

408408

409409
class ServerWithSelfSingedSSL(http.server.SimpleHTTPRequestHandler):
410-
def _set_headers(self):
411-
self.send_response(200)
412-
self.send_header('Content-type', 'application/json')
410+
def _set_headers(self, response: bytes):
411+
self.send_response(http.HTTPStatus.OK)
412+
self.send_header("Content-type", 'application/json')
413+
self.send_header("Content-Length", f'{len(response)}')
414+
self.send_header("Last-Modified", self.date_time_string())
413415
self.end_headers()
414416

415417
def do_GET(self):
416-
self._set_headers()
417418
response = json.dumps(
418419
dict(name="influxdb", message="ready for queries and writes", status="pass", checks=[], version="2.0.0",
419420
commit="abcdefgh")).encode('utf-8')
421+
self._set_headers(response)
420422
self.wfile.write(response)
423+
424+
425+
# def do_GET(self):
426+
# response = json.dumps(
427+
# dict(name="influxdb", message="ready for queries and writes", status="pass", checks=[], version="2.0.0",
428+
# commit="abcdefgh")).encode('utf-8')
429+
# self.send_response(http.HTTPStatus.OK)
430+
# self.send_header("Content-type", 'application/json')
431+
# self.send_header("Content-Length", f'{len(response)}')
432+
# self.send_header("Last-Modified", self.date_time_string())
433+
# self.end_headers()
434+
# self.wfile.write(response)

0 commit comments

Comments
 (0)