mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
results.dicts() method, closes #2414
This commit is contained in:
parent
dc288056b8
commit
92c4d41ca6
6 changed files with 28 additions and 17 deletions
|
|
@ -40,6 +40,17 @@ async def test_results_bool(db, expected):
|
|||
assert bool(results) is expected
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_results_dicts(db):
|
||||
results = await db.execute("select pk, name from roadside_attractions")
|
||||
assert results.dicts() == [
|
||||
{"pk": 1, "name": "The Mystery Spot"},
|
||||
{"pk": 2, "name": "Winchester Mystery House"},
|
||||
{"pk": 3, "name": "Burlingame Museum of PEZ Memorabilia"},
|
||||
{"pk": 4, "name": "Bigfoot Discovery Museum"},
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query,expected",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue