Changeset b0695c6 in mod_gnutls
- Timestamp:
- Apr 7, 2020, 2:44:48 PM (3 years ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- 0484b31
- Parents:
- 1a85a3d
- Location:
- test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
r1a85a3d rb0695c6 18 18 import contextlib 19 19 import os 20 import yaml 20 21 21 22 from mgstest.tests import run_test_conf … … 52 53 53 54 with contextlib.closing(args.test_config): 54 run_test_conf(args.test_config, args.timeout) 55 test_conf = yaml.load(args.test_config, Loader=yaml.Loader) 56 run_test_conf(test_conf, args.timeout) -
test/mgstest/tests.py
r1a85a3d rb0695c6 545 545 """Load and run a test configuration. 546 546 547 The test_conf parameter must be a YAML file, defining one or more548 TestConnections, to be run in order. The other three parameters549 are forwarded to TestConnection.run().547 The test_conf parameter must either a single TestConnection 548 object, or a list of such objects to be run in order. The other 549 three parameters are forwarded to TestConnection.run(). 550 550 551 551 """ 552 552 conns = None 553 553 554 config = yaml.load(test_config, Loader=yaml.Loader) 555 if type(config) is TestConnection: 556 conns = [config] 557 elif type(config) is list: 554 if type(test_config) is TestConnection: 555 conns = [test_config] 556 elif type(test_config) is list: 558 557 # assume list elements are connections 559 conns = config558 conns = test_config 560 559 else: 561 raise TypeError(f'Unsupported configuration: { config!r}')560 raise TypeError(f'Unsupported configuration: {test_config!r}') 562 561 sys.stdout.flush() 563 562 -
test/runtest.py
r1a85a3d rb0695c6 22 22 import sys 23 23 import tempfile 24 import yaml 24 25 from unittest import SkipTest 25 26 … … 100 101 os.environ['TEST_NAME'] = testname 101 102 103 # Load test config 104 try: 105 with open(os.path.join(testdir, 'test.yml'), 'r') as conf_file: 106 test_conf = yaml.load(conf_file, Loader=yaml.Loader) 107 except FileNotFoundError: 108 test_conf = None 109 102 110 # Load test case hooks (if any) 103 111 plugin_path = os.path.join(testdir, 'hooks.py') … … 194 202 response_log=args.log_responses) 195 203 else: 196 with open(os.path.join(testdir, 'test.yml'), 'r') as test_conf: 197 run_test_conf(test_conf, 198 float(os.environ.get('TEST_QUERY_TIMEOUT', 5.0)), 199 conn_log=args.log_connection, 200 response_log=args.log_responses) 204 run_test_conf(test_conf, 205 float(os.environ.get('TEST_QUERY_TIMEOUT', 5.0)), 206 conn_log=args.log_connection, 207 response_log=args.log_responses) 201 208 202 209 # run extra checks the test's hooks.py might define
Note: See TracChangeset
for help on using the changeset viewer.