Skip to content

Commit

Permalink
Making mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsimb committed Mar 11, 2024
1 parent 5db3a6b commit 9d0759f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion exasol/nb_connector/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def open_sqlalchemy_connection(conf: Secrets):
username=conf.get(CKey.db_user),
password=conf.get(CKey.db_password),
host=conf.get(CKey.db_host_name),
port=int(conf.get(CKey.db_port)),
port=int(getattr(conf, CKey.db_port.name)),
database=conf.get(CKey.db_schema),
query=query_params
)
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def test_open_pyexasol_connection_error(mock_connect, conf):

@unittest.mock.patch("sqlalchemy.create_engine")
def test_open_sqlalchemy_connection(mock_create_engine, conf):
setattr(conf, CKey.db_port.name, conf.get(CKey.db_port))
open_sqlalchemy_connection(conf)
mock_create_engine.assert_called_once_with(
make_url(f"exa+websocket://{conf.get(CKey.db_user)}:{conf.get(CKey.db_password)}@{get_external_host(conf)}")
Expand All @@ -117,6 +118,7 @@ def test_open_sqlalchemy_connection(mock_create_engine, conf):
def test_open_sqlalchemy_connection_ssl(mock_create_engine, conf):
conf.save(CKey.db_encryption, "True")
conf.save(CKey.cert_vld, "False")
setattr(conf, CKey.db_port.name, conf.get(CKey.db_port))

open_sqlalchemy_connection(conf)
mock_create_engine.assert_called_once_with(
Expand Down

0 comments on commit 9d0759f

Please sign in to comment.