Skip to content

Commit

Permalink
Modify test to check engine was created.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddbirchard committed Dec 25, 2024
1 parent 10fc6f2 commit 8db63b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""PyTest mocked fixtures."""

import pytest

from clients import Database
from config import settings

Expand All @@ -8,7 +10,7 @@
def db() -> Database:
"""Return a valid database object."""
return Database(
uri = settings.SQLALCHEMY_DATABASE_URI,
table = settings.SQLALCHEMY_DATABASE_TABLE,
args = settings.SQLALCHEMY_CONNECT_ARGS,
uri=settings.SQLALCHEMY_DATABASE_URI,
table=settings.SQLALCHEMY_DATABASE_TABLE,
args=settings.SQLALCHEMY_CONNECT_ARGS,
)
6 changes: 3 additions & 3 deletions tests/test_table_fetch.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Basic tests for validating app functionality."""

from pandas import DataFrame
from sqlalchemy.engine import Engine

from clients.database import Database


def test_fetch_sql_data(db: Database):
"""Test fetching data from a table."""
data = db.get_table_data()
assert isinstance(data, DataFrame)
db_engine = db.engine
assert isinstance(db_engine, Engine)

0 comments on commit 8db63b5

Please sign in to comment.