mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-12 11:34:09 +02:00
Test repeated calls to Table.convert()
This commit is contained in:
parent
fc221f9b62
commit
fc73af7a55
1 changed files with 9 additions and 0 deletions
|
|
@ -137,3 +137,12 @@ def test_convert_multi_exception(fresh_db):
|
|||
table.insert({"title": "Mixed Case"})
|
||||
with pytest.raises(BadMultiValues):
|
||||
table.convert("title", lambda v: v.upper(), multi=True)
|
||||
|
||||
|
||||
def test_convert_repeated(fresh_db):
|
||||
table = fresh_db["table"]
|
||||
col = "num"
|
||||
table.insert({col: 1})
|
||||
table.convert(col, lambda x: x*2)
|
||||
table.convert(col, lambda _x: 0)
|
||||
assert table.get(1) == {col: 0}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue