test semantics

This commit is contained in:
2026-03-21 15:23:06 +03:00
parent 9b47b9b667
commit 0b275ed3d1
14 changed files with 467 additions and 101 deletions

View File

@@ -37,6 +37,8 @@ def make_adapter():
client = MagicMock()
client.network = MagicMock()
return SupersetCompilationAdapter(environment=environment, client=client), client
# [/DEF:make_adapter:Function]
@@ -61,6 +63,8 @@ def test_preview_prefers_supported_client_method_before_network_fallback():
assert preview.compiled_sql == "SELECT 1"
client.compile_preview.assert_called_once()
client.network.request.assert_not_called()
# [/DEF:test_preview_prefers_supported_client_method_before_network_fallback:Function]
@@ -88,10 +92,14 @@ def test_preview_falls_back_across_matrix_until_supported_endpoint_returns_sql()
assert preview.preview_status.value == "ready"
assert preview.compiled_sql == "SELECT * FROM dataset_77"
assert client.network.request.call_count == 2
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
first_call = client.network.request.call_args_list[0].kwargs
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
second_call = client.network.request.call_args_list[1].kwargs
assert first_call["endpoint"] == "/dataset/77/preview"
assert second_call["endpoint"] == "/dataset/77/sql"
# [/DEF:test_preview_falls_back_across_matrix_until_supported_endpoint_returns_sql:Function]
@@ -124,11 +132,15 @@ def test_sql_lab_launch_falls_back_to_legacy_execute_endpoint():
assert sql_lab_ref == "query-123"
assert client.network.request.call_count == 2
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
first_call = client.network.request.call_args_list[0].kwargs
# @FRAGILE: Positional call assertion — ordering changes will break this test without indicating a real regression. Prefer content-based assertion.
second_call = client.network.request.call_args_list[1].kwargs
assert first_call["endpoint"] == "/sqllab/execute/"
assert second_call["endpoint"] == "/sql_lab/execute/"
# [/DEF:test_sql_lab_launch_falls_back_to_legacy_execute_endpoint:Function]
# [/DEF:SupersetCompatibilityMatrixTests:Module]
# [/DEF:SupersetCompatibilityMatrixTests:Module]