Skip to content

Commit

Permalink
fix valid stein test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
hallvictoria committed Jan 21, 2025
1 parent 9150508 commit a1822ca
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)


@app.route(route="double_underscore")
@app.route(route="double_underscore", trigger_arg_name="req__snake")
def double_underscore(req__snake: func.HttpRequest) -> func.HttpResponse:
name = req__snake.params.get('name')
return func.HttpResponse(f"Hello, {name}.")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)


@app.route(route="double_underscore_prefix")
@app.route(route="double_underscore_prefix", trigger_arg_name="__req")
def classic_double_underscore(__req: func.HttpRequest) -> func.HttpResponse:
name = __req.params.get('name')
return func.HttpResponse(f"Hello, {name}.")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)


@app.route(route="double_underscore_suffix")
@app.route(route="double_underscore_suffix", trigger_arg_name="req__")
def double_underscore_suffix(req__: func.HttpRequest) -> func.HttpResponse:
name = req__.params.get('name')
return func.HttpResponse(f"Hello, {name}.")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)


@app.route(route="jsut_double_underscore")
@app.route(route="jsut_double_underscore", trigger_arg_name="__")
def jsut_double_underscore(__: func.HttpRequest) -> func.HttpResponse:
name = __.params.get('name')
return func.HttpResponse(f"Hello, {name}.")
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)


@app.route(route="python_main_keyword")
@app.route(route="python_main_keyword", trigger_arg_name="__main__")
def python_main_keyword(__main__: func.HttpRequest) -> func.HttpResponse:
name = __main__.params.get('name')
return func.HttpResponse(f"Hello, {name}.")
10 changes: 5 additions & 5 deletions tests/endtoend/snake_case_functions/valid_stein/function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)


@app.route(route="classic_snake_case")
@app.route(route="classic_snake_case", trigger_arg_name="req_snake")
def classic_snake_case(req_snake: func.HttpRequest) -> func.HttpResponse:
name = req_snake.params.get('name')
return func.HttpResponse(f"Hello, {name}.")

@app.route(route="single_underscore")
@app.route(route="single_underscore", trigger_arg_name="_")
def single_underscore(_: func.HttpRequest) -> func.HttpResponse:
name = _.params.get('name')
return func.HttpResponse(f"Hello, {name}.")

@app.route(route="underscore_prefix")
@app.route(route="underscore_prefix", trigger_arg_name="_req")
def underscore_prefix(_req: func.HttpRequest) -> func.HttpResponse:
name = _req.params.get('name')
return func.HttpResponse(f"Hello, {name}.")

@app.route(route="underscore_sufffix")
def underscore_sufffix(req_: func.HttpRequest) -> func.HttpResponse:
@app.route(route="underscore_suffix", trigger_arg_name="req_")
def underscore_suffix(req_: func.HttpRequest) -> func.HttpResponse:
name = req_.params.get('name')
return func.HttpResponse(f"Hello, {name}.")
4 changes: 2 additions & 2 deletions tests/endtoend/test_snake_case_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def test_underscore_prefix(self):
)

@testutils.retryable_test(3, 5)
def test_underscore_sufffix(self):
r = self.webhost.request('GET', 'underscore_sufffix',
def test_underscore_suffix(self):
r = self.webhost.request('GET', 'underscore_suffix',
params={'name': 'query'},
timeout=REQUEST_TIMEOUT_SEC)
self.assertTrue(r.ok)
Expand Down

0 comments on commit a1822ca

Please sign in to comment.