def test_parse_spec_with_local_auth_scheme(openapi_spec_generator):
  """Test parsing with a local (operation-level) security scheme."""
  openapi_spec = create_minimal_openapi_spec()
  openapi_spec["paths"]["/test"]["get"]["security"] = [{"local_auth": []}]
  openapi_spec["components"] = {
      "securitySchemes": {"local_auth": {"type": "http", "scheme": "bearer"}}
  }

  parsed_operations = openapi_spec_generator.parse(openapi_spec)
  op = parsed_operations[0]

  assert op.auth_scheme is not None
  assert op.auth_scheme.type_.value == "http"
  assert op.auth_scheme.scheme == "bearer"
Test parsing with a local (operation-level) security scheme.
tests/unittests/tools/openapi_tool/openapi_spec_parser/test_openapi_spec_parser.py