Skip to content

Commit

Permalink
added test to cover mock_profile
Browse files Browse the repository at this point in the history
Signed-off-by: Perttu Salonen <[email protected]>
  • Loading branch information
perttus committed Sep 18, 2023
1 parent 200477b commit 033f204
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/profiles/vertica/test_vertica_user_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def mock_vertica_conn(): # type: ignore
host="my_host",
login="my_user",
password="my_password",
port=5432,
port=5433,
schema="my_schema",
extra='{"database": "my_database"}',
)
Expand Down Expand Up @@ -112,6 +112,14 @@ def test_profile_mapping_selected(
assert isinstance(profile_mapping, VerticaUserPasswordProfileMapping)


def test_mock_profile() -> None:
"""
Tests that the mock profile port value get set correctly.
"""
profile = VerticaUserPasswordProfileMapping("mock_conn_id")
assert profile.mock_profile.get("port") == 5433


def test_profile_mapping_keeps_custom_port(mock_vertica_conn_custom_port: Connection) -> None:
profile = VerticaUserPasswordProfileMapping(mock_vertica_conn_custom_port.conn_id, {"schema": "my_schema"})
assert profile.profile["port"] == 7472
Expand Down

0 comments on commit 033f204

Please sign in to comment.