Compare commits

...

1 Commits

Author SHA1 Message Date
Claude Code
7f7bc21c8c test(mcp): patch _validate_update_against_dataset on the module, not the re-exported function
`test_dataset_id_passed_to_update_command` patched the symbol via the string
path "superset.mcp_service.chart.tool.update_chart._validate_update_against_dataset".
Because tool/__init__.py re-exports the update_chart *function*, mock's importer
resolves ...tool.update_chart to the function and raises AttributeError, failing
the test deterministically on master. Use patch.object(update_chart_module, ...)
to match the pattern the rest of the file already uses.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-15 10:44:08 -07:00

View File

@@ -1480,9 +1480,8 @@ class TestUpdateChartDatasetIdIntegration:
"superset.commands.chart.update.UpdateChartCommand",
new_callable=Mock,
)
@patch(
"superset.mcp_service.chart.tool.update_chart._validate_update_against_dataset",
return_value=None,
@patch.object(
update_chart_module, "_validate_update_against_dataset", return_value=None
)
@patch("superset.daos.chart.ChartDAO.find_by_id", new_callable=Mock)
@patch("superset.db.session")