Changeset 7054040 in mod_gnutls
- Timestamp:
- Dec 7, 2019, 10:46:02 AM (3 years ago)
- Branches:
- asyncio, main, master, proxy-ticket
- Children:
- 0e069b6
- Parents:
- 8b72599
- Location:
- test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/mgstest/tests.py
r8b72599 r7054040 136 136 print(format_response(resp, body)) 137 137 self.check_response(resp, body) 138 139 def check_headers(self, headers): 140 for name, expected in self.expect['headers'].items(): 141 value = headers.get(name) 142 expected = subst_env(expected) 143 if value != expected: 144 raise TestExpectationFailed( 145 f'Unexpected value in header {name}: "{value}", ' 146 f'expected "{expected}"') 138 147 139 148 def check_body(self, body): … … 177 186 f'Unexpected status: {response.status} != ' 178 187 f'{self.expect["status"]}') 188 if 'headers' in self.expect: 189 self.check_headers(dict(response.getheaders())) 179 190 if 'body' in self.expect: 180 191 self.check_body(body) -
test/sample_test.yml
r8b72599 r7054040 21 21 expect: 22 22 status: 200 23 headers: 24 Content-Type: 'text/plain; charset=ISO-8859-1' 23 25 body: 24 26 contains:
Note: See TracChangeset
for help on using the changeset viewer.