Changeset c96a965 in mod_gnutls
- Timestamp:
- Dec 12, 2019, 6:48:09 AM (13 months ago)
- Branches:
- asyncio, master, proxy-ticket
- Children:
- c7f83a3
- Parents:
- b57d2c2
- Location:
- test
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
test/https-test-client.py
rb57d2c2 rc96a965 17 17 18 18 import os 19 import sys20 import yaml21 19 22 from mgstest.tests import TestConnection20 from mgstest.tests import run_test_conf 23 21 24 22 if __name__ == "__main__": … … 52 50 os.environ['TEST_PORT'] = args.port 53 51 54 conns = None 55 56 config = yaml.load(args.test_config, Loader=yaml.Loader) 57 if type(config) is TestConnection: 58 conns = [config] 59 elif type(config) is list: 60 # assume list elements are connections 61 conns = config 62 else: 63 raise TypeError(f'Unsupported configuration: {config!r}') 64 print(conns) 65 sys.stdout.flush() 66 67 for i, test_conn in enumerate(conns): 68 if test_conn.description: 69 print(f'Running test connection {i}: {test_conn.description}') 70 sys.stdout.flush() 71 test_conn.run(timeout=args.timeout) 52 run_test_conf(args.test_config, args.timeout) 53 args.test_config.close() -
test/mgstest/tests.py
rb57d2c2 rc96a965 367 367 t = Template(text) 368 368 return t.substitute(os.environ) 369 370 371 372 def run_test_conf(test_config, timeout=5.0): 373 conns = None 374 375 config = yaml.load(test_config, Loader=yaml.Loader) 376 if type(config) is TestConnection: 377 conns = [config] 378 elif type(config) is list: 379 # assume list elements are connections 380 conns = config 381 else: 382 raise TypeError(f'Unsupported configuration: {config!r}') 383 print(conns) 384 sys.stdout.flush() 385 386 for i, test_conn in enumerate(conns): 387 if test_conn.description: 388 print(f'Running test connection {i}: {test_conn.description}') 389 sys.stdout.flush() 390 test_conn.run(timeout=timeout)
Note: See TracChangeset
for help on using the changeset viewer.