mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
fix: schemas for upload API (#29604)
This commit is contained in:
@@ -461,3 +461,23 @@ def test_raw_connection_oauth(mocker: MockerFixture) -> None:
|
||||
with database.get_raw_connection() as conn:
|
||||
conn.cursor()
|
||||
assert str(excinfo.value) == "You don't have permission to access the data."
|
||||
|
||||
|
||||
def test_get_schema_access_for_file_upload() -> None:
|
||||
"""
|
||||
Test the `get_schema_access_for_file_upload` method.
|
||||
"""
|
||||
database = Database(
|
||||
database_name="first-database",
|
||||
sqlalchemy_uri="gsheets://",
|
||||
extra=json.dumps(
|
||||
{
|
||||
"metadata_params": {},
|
||||
"engine_params": {},
|
||||
"metadata_cache_timeout": {},
|
||||
"schemas_allowed_for_file_upload": '["public"]',
|
||||
}
|
||||
),
|
||||
)
|
||||
|
||||
assert database.get_schema_access_for_file_upload() == {"public"}
|
||||
|
||||
Reference in New Issue
Block a user