Skip to content

Commit 15da12f

Browse files
committed
Modify dynamic port (0) to port 8000 in class 7 of load_json_argv
1 parent 74afcf5 commit 15da12f

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

‎questionnaire_unit_test.py‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,8 @@ class _07_load_json_argv_with_data_via_localhost_8000_in_fixture(_03_load_json_a
165165

166166
# CAREFUL : localhost not always recognized, better to use 127.0.0.1
167167
# Port 0 can also be used and means to select an arbitrary unused port
168-
# HOST, PORT = "127.0.0.1", 8000
169-
# server_adr = f"http://{HOST}:{PORT}/"
170-
HOST, PORT = "127.0.0.1", 0
171-
server_adr = ''
168+
HOST, PORT = "127.0.0.1", 8000
169+
server_adr = f"http://{HOST}:{PORT}/"
172170
Handler = http.server.SimpleHTTPRequestHandler # Open a HTTP server to access to the current directory
173171
httpd = None
174172

@@ -189,10 +187,10 @@ def HTTPServer_Connection(self):
189187
# Exit the server thread when the main thread terminates
190188
server_thread.daemon = True
191189
server_thread.start()
192-
self.httpd_address, self.httpd_port = self.httpd.server_address
193-
self.httpd_url = f"http://{self.httpd_address}:{self.httpd_port}"
194-
print(f"Server URL = {self.httpd_url}")
195-
self.server_adr = f"http://{self.httpd_address}:{self.httpd_port}/"
190+
# self.httpd_address, self.httpd_port = self.httpd.server_address
191+
# self.httpd_url = f"http://{self.httpd_address}:{self.httpd_port}"
192+
# print(f"Server URL = {self.httpd_url}")
193+
# self.server_adr = f"http://{self.httpd_address}:{self.httpd_port}/"
196194
print(f"\n\nHTTP Connection to {self.server_adr} in {server_thread.name}", end=' ')
197195

198196
def HTTPServer_Disconnection(self):

0 commit comments

Comments
 (0)