bito-code-review[bot] commented on code in PR #44950:
URL: https://github.com/apache/superset/pull/44950#discussion_r4180463415
##########
tests/unit_tests/mcp_service/system/tool/test_get_schema.py:
##########
@@ -643,3 +644,17 @@ async def
test_resource_scope_is_enforced_when_rbac_disabled(self, app, mcp_serv
can_access.assert_not_called()
scope_allows.assert_called_once_with("read", "Chart")
+
+
[email protected]
+async def test_get_schema_chart_datasource_id(mcp_server: Any) -> None:
Review Comment:
<!-- Bito Reply -->
The suggestion provided by the reviewer is appropriate. Moving the test into
the existing class structure improves code organization and maintainability by
keeping related tests grouped together, which is consistent with the file's
established conventions.
##########
tests/unit_tests/mcp_service/system/tool/test_get_schema.py:
##########
@@ -643,3 +644,17 @@ async def
test_resource_scope_is_enforced_when_rbac_disabled(self, app, mcp_serv
can_access.assert_not_called()
scope_allows.assert_called_once_with("read", "Chart")
+
+
[email protected]
+async def test_get_schema_chart_datasource_id(mcp_server: Any) -> None:
+ """Chart discovery advertises the supported dataset ID operators."""
+ with patch.object(
+ get_schema_module, "user_can_view_data_model_metadata",
return_value=True
+ ):
Review Comment:
<!-- Bito Reply -->
The suggestion to remove the redundant `patch.object` is appropriate. Since
the autouse fixture `allow_data_model_metadata` already patches
`get_schema_module.user_can_view_data_model_metadata` to `True` for all tests
in the module, the additional patch is unnecessary and keeping it would
introduce redundant maintenance overhead.
**tests/unit_tests/mcp_service/system/tool/test_get_schema.py**
```
@pytest.mark.asyncio
async def test_get_schema_chart_datasource_id(mcp_server: Any) -> None:
"""Chart discovery advertises the supported dataset ID operators."""
# The redundant patch.object has been removed.
```
--
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]