Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
Added unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayank Dhiman committed Mar 11, 2021
1 parent c7cbe14 commit 6efe0e7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/settings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pytz
from mock import call, patch

from grouper.models.base.session import get_db_engine
from grouper.settings import DatabaseSourceException, InvalidSettingsError, Settings

if TYPE_CHECKING:
Expand Down Expand Up @@ -144,3 +145,11 @@ def test_mask_passsword_in_logs(caplog):

assert test_url not in caplog.text
assert expected_url in caplog.text


def test_bad_db_url():
# type: () -> None
bad_url = "This is not even a valid URL"
with pytest.raises(InvalidSettingsError):
engine = get_db_engine(bad_url)
assert engine

0 comments on commit 6efe0e7

Please sign in to comment.