Changeset c6d4701 in mod_gnutls
- Timestamp:
- Mar 10, 2021, 3:25:32 AM (23 months ago)
- Branches:
- master
- Children:
- 520ab08
- Parents:
- 3d7865f
- Location:
- test
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/Makefile.am
r3d7865f rc6d4701 50 50 TEST_EXTENSIONS = .bash .py 51 51 PY_LOG_COMPILER = $(PYTHON) 52 TESTS = doctest-mgstest.py $(test_scripts)52 TESTS = doctest-mgstest.py unittest-mgstest.py $(test_scripts) 53 53 54 54 check_PROGRAMS = pgpcrc … … 67 67 noinst_PYTHON = https-test-client.py mgstest/http.py mgstest/__init__.py \ 68 68 mgstest/hooks.py mgstest/ocsp.py mgstest/services.py \ 69 mgstest/softhsm.py mgstest/tests.py mgstest/valgrind.py runtest.py \ 70 softhsm-init.py doctest-mgstest.py required-modules.py data/ocsp.py \ 71 check_test_ips.py 69 mgstest/softhsm.py mgstest/tests.py mgstest/valgrind.py \ 70 mgstest/test_tests.py runtest.py \ 71 softhsm-init.py doctest-mgstest.py unittest-mgstest.py \ 72 required-modules.py data/ocsp.py check_test_ips.py 72 73 73 74 # Identities in the miniature CA, server, and client environment for -
test/mgstest/tests.py
r3d7865f rc6d4701 251 251 252 252 def check_headers(self, headers): 253 """254 >>> r1 = TestRequest(path='/test.txt',255 ... expect={'headers': {'X-Forbidden-Header': None,256 ... 'X-Required-Header': 'Hi!'}})257 >>> r1.check_headers({'X-Required-Header': 'Hi!'})258 >>> r1.check_headers({'X-Required-Header': 'Hello!'})259 Traceback (most recent call last):260 ...261 mgstest.TestExpectationFailed: Unexpected value in header \262 X-Required-Header: 'Hello!', expected 'Hi!'263 >>> r1.check_headers({'X-Forbidden-Header': 'Hi!'})264 Traceback (most recent call last):265 ...266 mgstest.TestExpectationFailed: Unexpected value in header \267 X-Forbidden-Header: 'Hi!', expected None268 """269 253 for name, expected in self.expect['headers'].items(): 270 254 value = headers.get(name) … … 276 260 277 261 def check_body(self, body): 278 """279 >>> r1 = TestRequest(path='/test.txt', method='GET', headers={}, \280 expect={'status': 200, 'body': {'exactly': 'test\\n'}})281 >>> r1.check_body('test\\n')282 >>> r1.check_body('xyz\\n')283 Traceback (most recent call last):284 ...285 mgstest.TestExpectationFailed: Unexpected body: 'xyz\\n' != 'test\\n'286 >>> r2 = TestRequest(path='/test.txt', method='GET', headers={}, \287 expect={'status': 200, 'body': {'contains': ['tes', 'est']}})288 >>> r2.check_body('test\\n')289 >>> r2.check_body('est\\n')290 Traceback (most recent call last):291 ...292 mgstest.TestExpectationFailed: Unexpected body: 'est\\n' \293 does not contain 'tes'294 >>> r3 = TestRequest(path='/test.txt', method='GET', headers={}, \295 expect={'status': 200, 'body': {'contains': 'test'}})296 >>> r3.check_body('test\\n')297 """298 262 if 'exactly' in self.expect['body'] \ 299 263 and body != self.expect['body']['exactly']: … … 328 292 connection being reset. That usually means the underlying TLS 329 293 connection failed. 330 331 >>> r1 = TestRequest(path='/test.txt', method='GET', headers={}, \332 expect={'status': 200, 'body': {'contains': 'test'}})333 >>> r1.expects_conn_reset()334 False335 >>> r2 = TestRequest(path='/test.txt', method='GET', headers={}, \336 expect={'reset': True})337 >>> r2.expects_conn_reset()338 True339 294 """ 340 295 if 'reset' in self.expect:
Note: See TracChangeset
for help on using the changeset viewer.