Changeset a4e136a in mod_gnutls
- Timestamp:
- Dec 1, 2019, 10:10:21 AM (3 years ago)
- Branches:
- asyncio, main, master, proxy-ticket
- Children:
- 096859f
- Parents:
- d5f5356
- Location:
- test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
rd5f5356 ra4e136a 68 68 class TestRequest(yaml.YAMLObject): 69 69 yaml_tag = '!request' 70 def __init__(self, path, expect=dict(status=200), method='GET'): 70 def __init__(self, path, method='GET', headers=dict(), 71 expect=dict(status=200)): 71 72 self.method = method 72 73 self.path = path 74 self.headers = headers 73 75 self.expect = expect 74 76 75 77 def __repr__(self): 76 78 return (f'{self.__class__.__name__!s}(path={self.path!r}, ' 77 f'expect={self.expect!r}, method={self.method!r})') 79 f'method={self.method!r}), headers={self.headers!r}, ' 80 f'expect={self.expect!r}') 78 81 79 82 def check_response(self, response, body): … … 195 198 # Add headers={'Host': 'test.host'} to provoke "421 196 199 # Misdirected 197 conn.request(act.method, act.path )200 conn.request(act.method, act.path, headers=act.headers) 198 201 resp = conn.getresponse() 199 202 body = resp.read().decode() -
test/sample_test.yml
rd5f5356 ra4e136a 5 5 - !request 6 6 path: / 7 headers: 8 Host: localhost 7 9 expect: 8 10 status: 404
Note: See TracChangeset
for help on using the changeset viewer.