-
-
Notifications
You must be signed in to change notification settings - Fork 983
fix: validate empty resources for non-suffix responders #2564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
418e5bb
a7261ae
9cb2225
39034a4
4cc4dc7
4c34c0b
58eca02
b92b496
ef16e94
746dabc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1087,7 +1087,8 @@ async def on_websocket(self, req, ws): | |
|
|
||
| async def test_ws_simulator_collect_edge_cases(conductor): | ||
| class Resource: | ||
| pass | ||
| async def on_websocket(self, req, ws): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe adding an unrelated method (such as |
||
| pass | ||
|
|
||
| conductor.app.add_route('/', Resource()) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,11 +40,6 @@ | |
| ] | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def stonewall(): | ||
| return Stonewall() | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def resource_things(): | ||
| return ThingsResource() | ||
|
|
@@ -64,8 +59,6 @@ def resource_get_with_faulty_put(): | |
| def client(asgi, util): | ||
| app = util.create_app(asgi) | ||
|
|
||
| app.add_route('/stonewall', Stonewall()) | ||
|
|
||
| resource_things = ThingsResource() | ||
| app.add_route('/things', resource_things) | ||
| app.add_route('/things/{id}/stuff/{sid}', resource_things) | ||
|
|
@@ -115,10 +108,6 @@ def on_websocket(self, req, resp, id, sid): | |
| self.called = True | ||
|
|
||
|
|
||
| class Stonewall: | ||
| pass | ||
|
|
||
|
|
||
| def capture(func): | ||
| @wraps(func) | ||
| def with_capture(*args, **kwargs): | ||
|
|
@@ -238,12 +227,6 @@ def test_misc(self, client, resource_misc, catch_wsgiref_query_warning): | |
| assert resource_misc.called | ||
| assert resource_misc.req.method == method | ||
|
|
||
| def test_methods_not_allowed_simple(self, client, stonewall): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's leave this stonewall test intact (until Falcon 5.0, that is), just assert with |
||
| client.app.add_route('/stonewall', stonewall) | ||
| for method in ['GET', 'HEAD', 'PUT', 'PATCH']: | ||
| response = client.simulate_request(path='/stonewall', method=method) | ||
| assert response.status == falcon.HTTP_405 | ||
|
|
||
| def test_methods_not_allowed_complex( | ||
| self, client, resource_things, catch_wsgiref_query_warning | ||
| ): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.