Test repeated calls to Table.convert()

This commit is contained in:
Martin Carpenter 2023-02-08 23:29:59 +01:00
commit fc73af7a55

View file

@ -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}