fix: complete theme management system import/export (#34850)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Maxime Beauchemin
2025-09-01 15:44:01 -07:00
committed by GitHub
parent c1a3606774
commit 4695be5cc5
19 changed files with 377 additions and 303 deletions

View File

@@ -609,7 +609,7 @@ class TestImportDatabasesCommand(SupersetTestCase):
command = ImportDatabasesCommand(contents)
with pytest.raises(CommandInvalidError) as excinfo:
command.run()
assert str(excinfo.value) == "Error importing database"
assert str(excinfo.value).startswith("Error importing database")
assert excinfo.value.normalized_messages() == {
"metadata.yaml": {"type": ["Must be equal to Database."]}
}
@@ -622,7 +622,7 @@ class TestImportDatabasesCommand(SupersetTestCase):
command = ImportDatabasesCommand(contents)
with pytest.raises(CommandInvalidError) as excinfo:
command.run()
assert str(excinfo.value) == "Error importing database"
assert str(excinfo.value).startswith("Error importing database")
assert excinfo.value.normalized_messages() == {
"datasets/imported_dataset.yaml": {
"table_name": ["Missing data for required field."],
@@ -643,7 +643,7 @@ class TestImportDatabasesCommand(SupersetTestCase):
command = ImportDatabasesCommand(contents)
with pytest.raises(CommandInvalidError) as excinfo:
command.run()
assert str(excinfo.value) == "Error importing database"
assert str(excinfo.value).startswith("Error importing database")
assert excinfo.value.normalized_messages() == {
"databases/imported_database.yaml": {
"_schema": ["Must provide a password for the database"]
@@ -667,7 +667,7 @@ class TestImportDatabasesCommand(SupersetTestCase):
command = ImportDatabasesCommand(contents)
with pytest.raises(CommandInvalidError) as excinfo:
command.run()
assert str(excinfo.value) == "Error importing database"
assert str(excinfo.value).startswith("Error importing database")
assert excinfo.value.normalized_messages() == {
"databases/imported_database.yaml": {
"_schema": ["Must provide a password for the ssh tunnel"]
@@ -691,7 +691,7 @@ class TestImportDatabasesCommand(SupersetTestCase):
command = ImportDatabasesCommand(contents)
with pytest.raises(CommandInvalidError) as excinfo:
command.run()
assert str(excinfo.value) == "Error importing database"
assert str(excinfo.value).startswith("Error importing database")
assert excinfo.value.normalized_messages() == {
"databases/imported_database.yaml": {
"_schema": [
@@ -855,7 +855,7 @@ class TestImportDatabasesCommand(SupersetTestCase):
command = ImportDatabasesCommand(contents)
with pytest.raises(CommandInvalidError) as excinfo:
command.run()
assert str(excinfo.value) == "Error importing database"
assert str(excinfo.value).startswith("Error importing database")
assert excinfo.value.normalized_messages() == {
"databases/imported_database.yaml": {
"_schema": [