Skip to content

Commit

Permalink
Add test for index.html dir for http.server
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraetor committed Dec 23, 2022
1 parent b89b070 commit ee23e37
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/test/test_httpservers.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,9 @@ def test_get(self):
self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
response = self.request('/' + 'ThisDoesNotExist' + '/')
self.check_status_and_reason(response, HTTPStatus.NOT_FOUND)
os.makedirs(os.path.join(self.tempdir, 'spam', 'index.html'))
response = self.request(self.base_url + '/spam/')
self.check_status_and_reason(response, HTTPStatus.OK)

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

0 comments on commit ee23e37

Please sign in to comment.