Skip to content

Commit 6785049

Browse files
committed
Add test for index.html dir for http.server
1 parent 977d05c commit 6785049

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_httpservers.py

+3
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,9 @@ def test_get(self):
489489
self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
490490
response = self.request('/' + 'ThisDoesNotExist' + '/')
491491
self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
492+
os.makedirs(os.path.join(self.tempdir, 'spam', 'index.html'))
493+
response = self.request(self.base_url + '/spam/')
494+
self.check_status_and_reason(response, HTTPStatus.OK)
492495

493496
data = b"Dummy index file\r\n"
494497
with open(os.path.join(self.tempdir_name, 'index.html'), 'wb') as f:

0 commit comments

Comments
 (0)