mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Test for bool(results), closes #1832
This commit is contained in:
parent
b6ba117b79
commit
bbf33a7635
1 changed files with 8 additions and 0 deletions
|
|
@ -30,6 +30,14 @@ async def test_results_first(db):
|
|||
assert isinstance(row, sqlite3.Row)
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("expected", (True, False))
|
||||
async def test_results_bool(db, expected):
|
||||
where = "" if expected else "where pk = 0"
|
||||
results = await db.execute("select * from facetable {}".format(where))
|
||||
assert bool(results) is expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"query,expected",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue