Skip to content

Commit

Permalink
registering other objects
Browse files Browse the repository at this point in the history
  • Loading branch information
ADBond committed Jan 2, 2025
1 parent 560b338 commit 6198b9e
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions tests/test_db_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import pandas as pd


def test_register_pandas_types(api_info, fake_1000, fake_1000_settings_factory):
def test_register_pandas_types(api_info):
db_api = api_info["db_api_factory"]()
df = pd.DataFrame(
{
Expand All @@ -18,4 +18,27 @@ def test_register_pandas_types(api_info, fake_1000, fake_1000_settings_factory):
"date_int": [-1_242, 765, 3_912],
}
)
db_api.register_table(df, "my_input_table")
db_api.register_table(df, "my_pandas_input_table")


def test_register_records_list(api_info):
db_api = api_info["db_api_factory"]()

records_list = [
{"id": 1, "name": "one"},
{"id": 2, "name": "two"},
{"id": 3, "name": "three"},
]

db_api.register_table(records_list, "my_list_input_table")


def test_register_data_dict(api_info):
db_api = api_info["db_api_factory"]()

records_dict = {
"id": [1, 2, 3],
"name": ["a", "b", "c"],
}

db_api.register_table(records_dict, "my_dict_input_table")

0 comments on commit 6198b9e

Please sign in to comment.