diff --git a/aas_test_engines/__main__.py b/aas_test_engines/__main__.py index 220b373..37c154f 100644 --- a/aas_test_engines/__main__.py +++ b/aas_test_engines/__main__.py @@ -80,6 +80,10 @@ def run_api_test(argv): parser.add_argument('--no-verify', action='store_true', help='do not check TLS certificate') + parser.add_argument('--remove-path-prefix', + type=str, + default='', + help='remove prefix from all paths') parser.add_argument('--output', type=OutputFormats, default=OutputFormats.TEXT, @@ -106,6 +110,7 @@ def run_api_test(argv): exec_conf = api.ExecConf( dry=args.dry, verify=not args.no_verify, + remove_path_prefix=args.remove_path_prefix, ) result = api.execute_tests(args.server, suite, args.version, exec_conf) if args.output == OutputFormats.TEXT: diff --git a/aas_test_engines/api.py b/aas_test_engines/api.py index 1122c44..9402661 100644 --- a/aas_test_engines/api.py +++ b/aas_test_engines/api.py @@ -961,6 +961,11 @@ def execute_tests(server: str, suite: str, version: str = _DEFAULT_VERSION, conf if not result_root.ok(): return result_root + for operation in spec.open_api.operations.values(): + if operation.path.startswith(conf.remove_path_prefix): + # TODO: this will be permanent so that you cannot call this function again + operation.path = operation.path[len(conf.remove_path_prefix):] + # Check individual operations mat = ConfusionMatrix() for operation in spec.open_api.operations.values():