Changeset 407ca6e in mod_gnutls
- Timestamp:
- Jan 14, 2020, 4:25:48 PM (15 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 346c03b
- Parents:
- b22def6
- git-author:
- Fiona Klute <fiona.klute@…> (01/14/20 06:49:21)
- git-committer:
- Fiona Klute <fiona.klute@…> (01/14/20 16:25:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mgstest/tests.py
rb22def6 r407ca6e 209 209 """ 210 210 yaml_tag = '!request' 211 def __init__(self, path, method='GET', headers=dict(),211 def __init__(self, path, method='GET', body=None, headers=dict(), 212 212 expect=dict(status=200)): 213 213 self.method = method 214 214 self.path = path 215 self.body = body 215 216 self.headers = headers 216 217 self.expect = expect … … 218 219 def __repr__(self): 219 220 return (f'{self.__class__.__name__!s}(path={self.path!r}, ' 220 f'method={self.method!r}, headers={self.headers!r}, '221 f' expect={self.expect!r})')221 f'method={self.method!r}, body={self.body!r}, ' 222 f'headers={self.headers!r}, expect={self.expect!r})') 222 223 223 224 def run(self, conn, response_log=None): 224 225 try: 225 conn.request(self.method, self.path, headers=self.headers) 226 conn.request(self.method, self.path, body=self.body, 227 headers=self.headers) 226 228 resp = conn.getresponse() 227 229 if self.expects_conn_reset(): … … 351 353 super().__init__(**kwargs) 352 354 353 def __repr__(self):354 return (f'{self.__class__.__name__!s}'355 f'(method={self.method!r}, path={self.path!r}, '356 f'headers={self.headers!r}, expect={self.expect!r})')357 358 355 def run(self, command, timeout=None, conn_log=None, response_log=None): 359 356 req = f'{self.method} {self.path} HTTP/1.0\r\n' … … 361 358 req = req + f'{name}: {value}\r\n' 362 359 req = req + f'\r\n' 360 if self.body: 361 req = req + self.body 363 362 proc = subprocess.Popen(command, 364 363 stdout=subprocess.PIPE,
Note: See TracChangeset
for help on using the changeset viewer.