Slightly simplify some tests whilst reducing 'Any'-typing

This commit is contained in:
Olivier 'reivilibre 2024-07-30 12:42:18 +01:00
parent 98876d342f
commit d216a956b6

View file

@ -392,8 +392,7 @@ class WrapHtmlRequestHandlerTests(unittest.TestCase):
) )
self.assertEqual(channel.code, 301) self.assertEqual(channel.code, 301)
headers = channel.result["headers"] location_headers = channel.headers.getRawHeaders(b"Location", [])
location_headers = headers.getRawHeaders(b"Location", [])
self.assertEqual(location_headers, [b"/look/an/eagle"]) self.assertEqual(location_headers, [b"/look/an/eagle"])
def test_redirect_exception_with_cookie(self) -> None: def test_redirect_exception_with_cookie(self) -> None:
@ -415,7 +414,7 @@ class WrapHtmlRequestHandlerTests(unittest.TestCase):
) )
self.assertEqual(channel.code, 304) self.assertEqual(channel.code, 304)
headers = channel.result["headers"] headers = channel.headers
location_headers = headers.getRawHeaders(b"Location", []) location_headers = headers.getRawHeaders(b"Location", [])
self.assertEqual(location_headers, [b"/no/over/there"]) self.assertEqual(location_headers, [b"/no/over/there"])
cookies_headers = headers.getRawHeaders(b"Set-Cookie", []) cookies_headers = headers.getRawHeaders(b"Set-Cookie", [])