Skip to content

Commit

Permalink
rework test_wizard_postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
spodgorny9 committed Sep 13, 2024
1 parent feecfb1 commit a690afe
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/research_hub/retrieve_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


logger = logging.getLogger(__name__)
init_logger(__name__, log_level='DEBUG')
init_logger(__name__, log_level='INFO')
init_logger('elm', log_level='INFO')


Expand Down
11 changes: 9 additions & 2 deletions tests/test_wizard_postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,21 @@ def invoke_model(self, **kwargs): # pylint: disable=unused-argument
return dummy_response


def test_postgres():
def test_postgres(mocker):
"""Test to ensure correct response vector db."""

os.environ["EWIZ_DB_USER"] = "user"

mock_conn_cm = mocker.MagicMock()
mock_conn = mock_conn_cm.__enter__.return_value
mock_conn.cursor.return_value = Cursor()

mock_connect = mocker.patch('psycopg2.connect')
mock_connect.return_value = mock_conn_cm

wizard = EnergyWizardPostgres(db_host='Dummy', db_port='Dummy',
db_name='Dummy', db_schema='Dummy',
db_table='Dummy', cursor=Cursor(),
db_table='Dummy',
boto_client=BotoClient())

question = 'Is this a dummy question?'
Expand Down

0 comments on commit a690afe

Please sign in to comment.