mirror of
https://github.com/fhswf/aki_prj23_transparenzregister.git
synced 2025-06-22 06:43:55 +02:00
Replaced the bind with the connection method
This commit is contained in:
@ -45,15 +45,11 @@ def destination_db() -> Generator[Session, None, None]:
|
||||
def test_transfer_db(full_db: Session, destination_db: Session) -> None:
|
||||
"""Tests if the data transfer between two sql tables works."""
|
||||
transfer_db_function(source=full_db, destination=destination_db)
|
||||
sbind = full_db.bind
|
||||
dbind = destination_db.bind
|
||||
assert isinstance(sbind, Engine)
|
||||
assert isinstance(dbind, Engine)
|
||||
assert Base.metadata.sorted_tables
|
||||
for table in Base.metadata.sorted_tables + ["company"]:
|
||||
pd.testing.assert_frame_equal(
|
||||
pd.read_sql_table(str(table), dbind),
|
||||
pd.read_sql_table(str(table), sbind),
|
||||
pd.read_sql_table(str(table), destination_db.connection()),
|
||||
pd.read_sql_table(str(table), full_db.connection()),
|
||||
)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user