mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-28 11:54:32 +02:00
Initial implementation of table.get(...)
This commit is contained in:
parent
f70e35c9bb
commit
a9fd1e785f
2 changed files with 41 additions and 0 deletions
|
|
@ -1,6 +1,20 @@
|
|||
import pytest
|
||||
|
||||
|
||||
def test_get_rowid(fresh_db):
|
||||
dogs = fresh_db["dogs"]
|
||||
cleo = {"name": "Cleo", "age": 4}
|
||||
row_id = dogs.insert(cleo).last_rowid
|
||||
assert cleo == dogs.get(row_id)
|
||||
|
||||
|
||||
def test_get_primary_key(fresh_db):
|
||||
dogs = fresh_db["dogs"]
|
||||
cleo = {"name": "Cleo", "age": 4, "id": 5}
|
||||
row_id = dogs.insert(cleo, pk="id").last_pk
|
||||
assert cleo == dogs.get(5)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"where,where_args,expected_ids",
|
||||
[
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue