Skip to content

Commit de58e3a

Browse files
committed
Updated http tests
1 parent 3e60eed commit de58e3a

3 files changed

Lines changed: 14 additions & 1 deletion

File tree

Lib/test/test_http_cookiejar.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,6 @@ def test_ns_parser_special_names(self):
655655
self.assertIn('expires', cookies)
656656
self.assertIn('version', cookies)
657657

658-
@unittest.expectedFailure # TODO: RUSTPYTHON; need to update http library to remove warnings
659658
def test_expires(self):
660659
# if expires is in future, keep cookie...
661660
c = CookieJar()

Lib/test/test_httplib.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2098,6 +2098,7 @@ def test_local_unknown_cert(self):
20982098
h.request('GET', '/')
20992099
self.assertEqual(exc_info.exception.reason, 'CERTIFICATE_VERIFY_FAILED')
21002100

2101+
@unittest.expectedFailure # TODO: RUSTPYTHON http.client.RemoteDisconnected: Remote end closed connection without response
21012102
def test_local_good_hostname(self):
21022103
# The (valid) cert validates the HTTPS hostname
21032104
import ssl
@@ -2111,6 +2112,7 @@ def test_local_good_hostname(self):
21112112
self.addCleanup(resp.close)
21122113
self.assertEqual(resp.status, 404)
21132114

2115+
@unittest.expectedFailure # TODO: RUSTPYTHON http.client.RemoteDisconnected: Remote end closed connection without response
21142116
def test_local_bad_hostname(self):
21152117
# The (valid) cert doesn't validate the HTTPS hostname
21162118
import ssl

Lib/test/test_httpservers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,7 @@ def test_list_dir_nonascii_dirname(self):
498498

499499
@unittest.skipUnless(os_helper.TESTFN_NONASCII,
500500
'need os_helper.TESTFN_NONASCII')
501+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
501502
def test_list_dir_nonascii_filename(self):
502503
filename = os_helper.TESTFN_NONASCII + '.txt'
503504
self.check_list_dir_filename(filename)
@@ -518,6 +519,7 @@ def test_list_dir_undecodable_dirname(self):
518519
'undecodable name cannot be decoded on win32')
519520
@unittest.skipUnless(os_helper.TESTFN_UNDECODABLE,
520521
'need os_helper.TESTFN_UNDECODABLE')
522+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
521523
def test_list_dir_undecodable_filename(self):
522524
filename = os.fsdecode(os_helper.TESTFN_UNDECODABLE) + '.txt'
523525
self.check_list_dir_filename(filename)
@@ -534,6 +536,7 @@ def test_list_dir_unencodable_dirname(self):
534536

535537
@unittest.skipUnless(os_helper.TESTFN_UNENCODABLE,
536538
'need os_helper.TESTFN_UNENCODABLE')
539+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
537540
def test_list_dir_unencodable_filename(self):
538541
filename = os_helper.TESTFN_UNENCODABLE + '.txt'
539542
self.check_list_dir_filename(filename)
@@ -547,6 +550,7 @@ def test_list_dir_escape_dirname(self):
547550
self.check_list_dir_dirname(dirname,
548551
quotedname=urllib.parse.quote(dirname, safe='&<>\'"'))
549552

553+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
550554
def test_list_dir_escape_filename(self):
551555
# Characters that need special treating in URL or HTML.
552556
for name in ('q?', 'f#', '&amp;', '&amp', '<i>', '"dq"', "'sq'",
@@ -665,6 +669,7 @@ def test_get(self):
665669
finally:
666670
os.chmod(self.tempdir, 0o755)
667671

672+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
668673
def test_head(self):
669674
response = self.request(
670675
self.base_url + '/test', method='HEAD')
@@ -674,6 +679,7 @@ def test_head(self):
674679
self.assertEqual(response.getheader('content-type'),
675680
'application/octet-stream')
676681

682+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
677683
def test_browser_cache(self):
678684
"""Check that when a request to /test is sent with the request header
679685
If-Modified-Since set to date of last modification, the server returns
@@ -692,6 +698,7 @@ def test_browser_cache(self):
692698
response = self.request(self.base_url + '/test', headers=headers)
693699
self.check_status_and_reason(response, HTTPStatus.NOT_MODIFIED)
694700

701+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
695702
def test_browser_cache_file_changed(self):
696703
# with If-Modified-Since earlier than Last-Modified, must return 200
697704
dt = self.last_modif_datetime
@@ -703,6 +710,7 @@ def test_browser_cache_file_changed(self):
703710
response = self.request(self.base_url + '/test', headers=headers)
704711
self.check_status_and_reason(response, HTTPStatus.OK)
705712

713+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
706714
def test_browser_cache_with_If_None_Match_header(self):
707715
# if If-None-Match header is present, ignore If-Modified-Since
708716

@@ -721,6 +729,7 @@ def test_invalid_requests(self):
721729
response = self.request('/', method='GETs')
722730
self.check_status_and_reason(response, HTTPStatus.NOT_IMPLEMENTED)
723731

732+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
724733
def test_last_modified(self):
725734
"""Checks that the datetime returned in Last-Modified response header
726735
is the actual datetime of last modification, rounded to the second
@@ -730,6 +739,7 @@ def test_last_modified(self):
730739
last_modif_header = response.headers['Last-modified']
731740
self.assertEqual(last_modif_header, self.last_modif_header)
732741

742+
@unittest.expectedFailure # TODO: RUSTPYTHON; http.client.RemoteDisconnected: Remote end closed connection without response
733743
def test_path_without_leading_slash(self):
734744
response = self.request(self.tempdir_name + '/test')
735745
self.check_status_and_reason(response, HTTPStatus.OK, data=self.data)
@@ -1015,6 +1025,7 @@ def test_post(self):
10151025

10161026
self.assertEqual(res.read(), b'1, python, 123456' + self.linesep)
10171027

1028+
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: b'' != b'32768 32768\n'
10181029
def test_large_content_length(self):
10191030
for w in range(15, 25):
10201031
size = 1 << w
@@ -1023,6 +1034,7 @@ def test_large_content_length(self):
10231034
res = self.request('/cgi-bin/file7.py', 'POST', body, headers)
10241035
self.assertEqual(res.read(), b'%d %d' % (size, size) + self.linesep)
10251036

1037+
@unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: b'' != b'Hello World\n'
10261038
def test_large_content_length_truncated(self):
10271039
with support.swap_attr(self.request_handler, 'timeout', 0.001):
10281040
for w in range(18, 65):

0 commit comments

Comments
 (0)