mirror of
https://github.com/quay/quay.git
synced 2026-01-27 18:42:52 +03:00
* chore: update werkzeug and related package versions (PROJQUAY-5098) Path converter related change reference: https://github.com/pallets/werkzeug/issues/2506 * Update query count
41 lines
1.0 KiB
Python
41 lines
1.0 KiB
Python
import pytest
|
|
|
|
from app import app
|
|
from endpoints.v1 import v1_bp
|
|
from endpoints.v2 import v2_bp
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"blueprint",
|
|
[
|
|
v2_bp,
|
|
v1_bp,
|
|
],
|
|
)
|
|
def test_verify_blueprint(blueprint):
|
|
class Checker(object):
|
|
def __init__(self):
|
|
self.first_registration = True
|
|
self.app = app
|
|
|
|
def add_url_rule(
|
|
self,
|
|
rule,
|
|
endpoint=None,
|
|
view_function=None,
|
|
methods=None,
|
|
provide_automatic_options=None,
|
|
**options,
|
|
):
|
|
result = "__anon_protected" in dir(view_function) or "__anon_allowed" in dir(
|
|
view_function
|
|
)
|
|
error_message = (
|
|
"Missing anonymous access protection decorator on function "
|
|
+ "%s under blueprint %s" % (endpoint, blueprint.name)
|
|
)
|
|
assert result, error_message
|
|
|
|
for deferred_function in blueprint.deferred_functions:
|
|
deferred_function(Checker())
|