chore: Changes the DatabaseSelector to use the new Select component (#16334)

This commit is contained in:
Michael S. Molina
2021-08-23 15:41:03 -03:00
committed by GitHub
parent 0cdc7675b4
commit c768941f2f
16 changed files with 694 additions and 833 deletions
+10 -4
View File
@@ -222,6 +222,7 @@ class TestDatasetApi(SupersetTestCase):
Dataset API: Test get dataset item
"""
table = self.get_energy_usage_dataset()
main_db = get_main_database()
self.login(username="admin")
uri = f"api/v1/dataset/{table.id}"
rv = self.get_assert_metric(uri, "get")
@@ -229,7 +230,11 @@ class TestDatasetApi(SupersetTestCase):
response = json.loads(rv.data.decode("utf-8"))
expected_result = {
"cache_timeout": None,
"database": {"database_name": "examples", "id": 1},
"database": {
"backend": main_db.backend,
"database_name": "examples",
"id": 1,
},
"default_endpoint": None,
"description": "Energy consumption",
"extra": None,
@@ -244,9 +249,10 @@ class TestDatasetApi(SupersetTestCase):
"table_name": "energy_usage",
"template_params": None,
}
assert {
k: v for k, v in response["result"].items() if k in expected_result
} == expected_result
if response["result"]["database"]["backend"] not in ("presto", "hive"):
assert {
k: v for k, v in response["result"].items() if k in expected_result
} == expected_result
assert len(response["result"]["columns"]) == 3
assert len(response["result"]["metrics"]) == 2