Skip to content

Commit

Permalink
Add --remove-path-prefix argument
Browse files Browse the repository at this point in the history
  • Loading branch information
otto-ifak committed Sep 5, 2024
1 parent f45a535 commit 52cffe9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions aas_test_engines/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions aas_test_engines/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 52cffe9

Please sign in to comment.