mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-09 18:14:09 +02:00
.insert(hash_id_columns=) parameter, closes #343
This commit is contained in:
parent
b6c9dfce0b
commit
931b1e1513
7 changed files with 158 additions and 15 deletions
|
|
@ -35,3 +35,17 @@ def test_chunks(size, expected):
|
|||
input = ["a", "b", "c", "d"]
|
||||
chunks = list(map(list, utils.chunks(input, size)))
|
||||
assert chunks == expected
|
||||
|
||||
|
||||
def test_hash_record():
|
||||
expected = "d383e7c0ba88f5ffcdd09be660de164b3847401a"
|
||||
assert utils.hash_record({"name": "Cleo", "twitter": "CleoPaws"}) == expected
|
||||
assert (
|
||||
utils.hash_record(
|
||||
{"name": "Cleo", "twitter": "CleoPaws", "age": 7}, keys=("name", "twitter")
|
||||
)
|
||||
== expected
|
||||
)
|
||||
assert (
|
||||
utils.hash_record({"name": "Cleo", "twitter": "CleoPaws", "age": 7}) != expected
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue