Changeset 6ea34b1 in mod_gnutls
- Timestamp:
- Dec 4, 2019, 10:00:58 AM (14 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- ec63b07
- Parents:
- 1de6754
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
r1de6754 r6ea34b1 127 127 self.check_response(resp, body) 128 128 129 def _check_body(self, body):129 def check_body(self, body): 130 130 """ 131 131 >>> r1 = TestRequest(path='/test.txt', method='GET', headers={}, expect={'status': 200, 'body': {'exactly': 'test\\n'}}) 132 >>> r1. _check_body('test\\n')133 >>> r1. _check_body('xyz\\n')132 >>> r1.check_body('test\\n') 133 >>> r1.check_body('xyz\\n') 134 134 Traceback (most recent call last): 135 135 ... 136 136 https-test-client.TestExpectationFailed: Unexpected body: 'xyz\\n' != 'test\\n' 137 137 >>> r2 = TestRequest(path='/test.txt', method='GET', headers={}, expect={'status': 200, 'body': {'contains': ['tes', 'est']}}) 138 >>> r2. _check_body('test\\n')139 >>> r2. _check_body('est\\n')138 >>> r2.check_body('test\\n') 139 >>> r2.check_body('est\\n') 140 140 Traceback (most recent call last): 141 141 ... 142 142 https-test-client.TestExpectationFailed: Unexpected body: 'est\\n' does not contain 'tes' 143 143 >>> r3 = TestRequest(path='/test.txt', method='GET', headers={}, expect={'status': 200, 'body': {'contains': 'test'}}) 144 >>> r3. _check_body('test\\n')144 >>> r3.check_body('test\\n') 145 145 """ 146 146 if 'exactly' in self.expect['body'] \ … … 168 168 f'{self.expect["status"]}') 169 169 if 'body' in self.expect: 170 self. _check_body(body)170 self.check_body(body) 171 171 172 172 def expects_conn_reset(self): … … 278 278 279 279 if 'body' in self.expect: 280 self. _check_body(body)280 self.check_body(body) 281 281 282 282 # Override the default constructors. Pyyaml ignores default parameters
Note: See TracChangeset
for help on using the changeset viewer.