bito-code-review[bot] commented on code in PR #44101:
URL: https://github.com/apache/superset/pull/44101#discussion_r4173130162
##########
tests/integration_tests/core_tests.py:
##########
@@ -953,6 +953,49 @@ def test_dashboard_permalink_returns_404_for_missing_state(
assert resp.status_code == 404
assert "Location" not in resp.headers
+ def test_extension_view_anonymous_redirects_to_login(self):
+ resp = self.client.get("/extensions/view/my-ext.settings")
+
+ expected_url = "/login/?next=%2Fextensions%2Fview%2Fmy-ext.settings"
+
+ assert resp.status_code == 302
+ assert resp.headers["Location"] == expected_url
+
+ def test_extension_view_authenticated_returns_spa_shell(self):
+ self.login(ADMIN_USERNAME)
+
+ resp = self.client.get("/extensions/view/my-ext.settings")
+
+ assert resp.status_code == 200
+ assert b'id="app"' in resp.data
+
+ def
test_extension_view_custom_role_without_extension_permission_returns_spa_shell(
+ self,
+ ):
+ # A custom role is never backfilled with the FAB-generated
+ # `can_extension_view` permission by role sync; the route is a
+ # login-only shell page, so such users shouldn't get a 403.
+ role_name = "ExtensionViewCustomRole"
+ username = "extension_view_custom_user"
+ role = security_manager.add_role(role_name)
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing test docstring</b></div>
<div id="fix">
BITO.md rule 12148 requires every new test function to carry a docstring
documenting the scenario and expected outcome, and explicitly states inline
comments do not substitute. This rewritten test (lines 972-997) has none; add a
brief docstring under the def.
</div>
</div>
<div id="suggestion">
<div id="issue"><b>Missing type annotations</b></div>
<div id="fix">
BITO.md rules 7819/13153 require explicit annotations on test methods and
their locals. The signature (lines 972-974) lacks `-> None:`, and locals
`role_name`/`username`/`role` (978-980) plus `user` (993) are unannotated.
</div>
</div>
<small><i>Code Review Run #e6ed78</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]