mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
chore: s/MockFixture/MockerFixture/g (#29160)
This commit is contained in:
@@ -28,7 +28,7 @@ from uuid import UUID
|
||||
import pytest
|
||||
from flask import current_app
|
||||
from freezegun import freeze_time
|
||||
from pytest_mock import MockFixture
|
||||
from pytest_mock import MockerFixture
|
||||
from sqlalchemy.orm.session import Session
|
||||
|
||||
from superset import db
|
||||
@@ -120,7 +120,7 @@ def test_post_with_uuid(
|
||||
|
||||
|
||||
def test_password_mask(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
app: Any,
|
||||
session: Session,
|
||||
client: Any,
|
||||
@@ -176,7 +176,7 @@ def test_password_mask(
|
||||
|
||||
|
||||
def test_database_connection(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
app: Any,
|
||||
session: Session,
|
||||
client: Any,
|
||||
@@ -409,7 +409,7 @@ def test_non_zip_import(client: Any, full_api_access: None) -> None:
|
||||
|
||||
|
||||
def test_delete_ssh_tunnel(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
app: Any,
|
||||
session: Session,
|
||||
client: Any,
|
||||
@@ -487,7 +487,7 @@ def test_delete_ssh_tunnel(
|
||||
|
||||
|
||||
def test_delete_ssh_tunnel_not_found(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
app: Any,
|
||||
session: Session,
|
||||
client: Any,
|
||||
@@ -563,7 +563,7 @@ def test_delete_ssh_tunnel_not_found(
|
||||
|
||||
|
||||
def test_apply_dynamic_database_filter(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
app: Any,
|
||||
session: Session,
|
||||
client: Any,
|
||||
@@ -659,7 +659,7 @@ def test_apply_dynamic_database_filter(
|
||||
|
||||
|
||||
def test_oauth2_happy_path(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
session: Session,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
@@ -727,7 +727,7 @@ def test_oauth2_happy_path(
|
||||
|
||||
|
||||
def test_oauth2_multiple_tokens(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
session: Session,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
@@ -807,7 +807,7 @@ def test_oauth2_multiple_tokens(
|
||||
|
||||
|
||||
def test_oauth2_error(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
session: Session,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
@@ -930,7 +930,7 @@ def test_csv_upload(
|
||||
payload: dict[str, Any],
|
||||
upload_called_with: tuple[int, str, Any, dict[str, Any]],
|
||||
reader_called_with: dict[str, Any],
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1070,7 +1070,7 @@ def test_csv_upload(
|
||||
def test_csv_upload_validation(
|
||||
payload: Any,
|
||||
expected_response: dict[str, str],
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1089,7 +1089,7 @@ def test_csv_upload_validation(
|
||||
|
||||
|
||||
def test_csv_upload_file_size_validation(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1131,7 +1131,7 @@ def test_csv_upload_file_size_validation(
|
||||
)
|
||||
def test_csv_upload_file_extension_invalid(
|
||||
filename: str,
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1167,7 +1167,7 @@ def test_csv_upload_file_extension_invalid(
|
||||
)
|
||||
def test_csv_upload_file_extension_valid(
|
||||
filename: str,
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1272,7 +1272,7 @@ def test_excel_upload(
|
||||
payload: dict[str, Any],
|
||||
upload_called_with: tuple[int, str, Any, dict[str, Any]],
|
||||
reader_called_with: dict[str, Any],
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1367,7 +1367,7 @@ def test_excel_upload(
|
||||
def test_excel_upload_validation(
|
||||
payload: Any,
|
||||
expected_response: dict[str, str],
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1402,7 +1402,7 @@ def test_excel_upload_validation(
|
||||
)
|
||||
def test_excel_upload_file_extension_invalid(
|
||||
filename: str,
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1478,7 +1478,7 @@ def test_columnar_upload(
|
||||
payload: dict[str, Any],
|
||||
upload_called_with: tuple[int, str, Any, dict[str, Any]],
|
||||
reader_called_with: dict[str, Any],
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1544,7 +1544,7 @@ def test_columnar_upload(
|
||||
def test_columnar_upload_validation(
|
||||
payload: Any,
|
||||
expected_response: dict[str, str],
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1574,7 +1574,7 @@ def test_columnar_upload_validation(
|
||||
)
|
||||
def test_columnar_upload_file_extension_valid(
|
||||
filename: str,
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1610,7 +1610,7 @@ def test_columnar_upload_file_extension_valid(
|
||||
)
|
||||
def test_columnar_upload_file_extension_invalid(
|
||||
filename: str,
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1630,7 +1630,9 @@ def test_columnar_upload_file_extension_invalid(
|
||||
assert response.json == {"message": {"file": ["File extension is not allowed."]}}
|
||||
|
||||
|
||||
def test_csv_metadata(mocker: MockFixture, client: Any, full_api_access: None) -> None:
|
||||
def test_csv_metadata(
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(CSVReader, "file_metadata")
|
||||
response = client.post(
|
||||
"/api/v1/database/csv_metadata/",
|
||||
@@ -1641,7 +1643,7 @@ def test_csv_metadata(mocker: MockFixture, client: Any, full_api_access: None) -
|
||||
|
||||
|
||||
def test_csv_metadata_bad_extension(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(CSVReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1654,7 +1656,7 @@ def test_csv_metadata_bad_extension(
|
||||
|
||||
|
||||
def test_csv_metadata_validation(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(CSVReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1667,7 +1669,7 @@ def test_csv_metadata_validation(
|
||||
|
||||
|
||||
def test_excel_metadata(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(ExcelReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1679,7 +1681,7 @@ def test_excel_metadata(
|
||||
|
||||
|
||||
def test_excel_metadata_bad_extension(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(ExcelReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1692,7 +1694,7 @@ def test_excel_metadata_bad_extension(
|
||||
|
||||
|
||||
def test_excel_metadata_validation(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(ExcelReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1705,7 +1707,7 @@ def test_excel_metadata_validation(
|
||||
|
||||
|
||||
def test_columnar_metadata(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(ColumnarReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1717,7 +1719,7 @@ def test_columnar_metadata(
|
||||
|
||||
|
||||
def test_columnar_metadata_bad_extension(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(ColumnarReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1730,7 +1732,7 @@ def test_columnar_metadata_bad_extension(
|
||||
|
||||
|
||||
def test_columnar_metadata_validation(
|
||||
mocker: MockFixture, client: Any, full_api_access: None
|
||||
mocker: MockerFixture, client: Any, full_api_access: None
|
||||
) -> None:
|
||||
_ = mocker.patch.object(ColumnarReader, "file_metadata")
|
||||
response = client.post(
|
||||
@@ -1743,7 +1745,7 @@ def test_columnar_metadata_validation(
|
||||
|
||||
|
||||
def test_table_metadata_happy_path(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1784,7 +1786,7 @@ def test_table_metadata_happy_path(
|
||||
|
||||
|
||||
def test_table_metadata_no_table(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1817,7 +1819,7 @@ def test_table_metadata_no_table(
|
||||
|
||||
|
||||
def test_table_metadata_slashes(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1837,7 +1839,7 @@ def test_table_metadata_slashes(
|
||||
|
||||
|
||||
def test_table_metadata_invalid_database(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1872,7 +1874,7 @@ def test_table_metadata_invalid_database(
|
||||
|
||||
|
||||
def test_table_metadata_unauthorized(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1907,7 +1909,7 @@ def test_table_metadata_unauthorized(
|
||||
|
||||
|
||||
def test_table_extra_metadata_happy_path(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1948,7 +1950,7 @@ def test_table_extra_metadata_happy_path(
|
||||
|
||||
|
||||
def test_table_extra_metadata_no_table(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -1981,7 +1983,7 @@ def test_table_extra_metadata_no_table(
|
||||
|
||||
|
||||
def test_table_extra_metadata_slashes(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -2001,7 +2003,7 @@ def test_table_extra_metadata_slashes(
|
||||
|
||||
|
||||
def test_table_extra_metadata_invalid_database(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -2036,7 +2038,7 @@ def test_table_extra_metadata_invalid_database(
|
||||
|
||||
|
||||
def test_table_extra_metadata_unauthorized(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -2071,7 +2073,7 @@ def test_table_extra_metadata_unauthorized(
|
||||
|
||||
|
||||
def test_catalogs(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
@@ -2111,7 +2113,7 @@ def test_catalogs(
|
||||
|
||||
|
||||
def test_schemas(
|
||||
mocker: MockFixture,
|
||||
mocker: MockerFixture,
|
||||
client: Any,
|
||||
full_api_access: None,
|
||||
) -> None:
|
||||
|
||||
Reference in New Issue
Block a user