def test_http_request(self): request = Request('http://example.com') request.fields['hello'] = 'world' new_request = convert_http_request(request) self.assertEqual('example.com', new_request.host) self.assertEqual('world', new_request.get_header('Hello'))
def test_http_request(self): request = Request.new('http://example.com') request.fields['hello'] = 'world' new_request = convert_http_request(request) if sys.version_info[0] == 2: self.assertEqual('example.com', new_request.get_host()) else: self.assertEqual('example.com', new_request.host) self.assertEqual('world', new_request.get_header('Hello'))