chore(database): Creating helper make_url_safe to wrap potential errors (#19526)

* Creating helper make_url_safe to wrap potential errors

* Fixing imports

* Fixing imports again

* Adding comment

* Linting

* Fixing test

* Fixing test again...

* Fixing import
This commit is contained in:
Craig Rueda
2022-04-05 11:17:30 -07:00
committed by GitHub
parent a59718b094
commit f64d654de3
18 changed files with 90 additions and 71 deletions

View File

@@ -24,6 +24,8 @@ import os
import re
from typing import Any, Tuple, List, Optional
from unittest.mock import Mock, patch
from superset.databases.commands.exceptions import DatabaseInvalidError
from tests.integration_tests.fixtures.birth_names_dashboard import (
load_birth_names_dashboard_with_slices,
load_birth_names_data,
@@ -736,7 +738,7 @@ class TestUtils(SupersetTestCase):
db.session.commit()
def test_get_or_create_db_invalid_uri(self):
with self.assertRaises(ArgumentError):
with self.assertRaises(DatabaseInvalidError):
get_or_create_db("test_db", "yoursql:superset.db/()")
def test_get_iterable(self):