Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Jul 26, 2023
1 parent 995a3f4 commit acb036f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -1588,3 +1588,24 @@ async def test_should_remove_ref_on_disconnect():
query = notes.select()
with pytest.raises(sqlite3.OperationalError):
await database.fetch_all(query=query)


@pytest.mark.parametrize("database_url", DATABASE_URLS)
@async_adapter
async def test_mapping_property_interface(database_url):
"""
Test that all connections implement interface with `_mapping` property
"""
async with Database(database_url) as database:
query = notes.insert()
values = {"text": "example1", "completed": True}
await database.execute(query, values)

query = notes.select()
single_result = await database.fetch_one(query=query)
assert single_result._mapping["text"] == "example1"
assert single_result._mapping["completed"] is True

list_result = await database.fetch_all(query=query)
assert list_result[0]._mapping["text"] == "example1"
assert list_result[0]._mapping["completed"] is True

0 comments on commit acb036f

Please sign in to comment.