mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-27 20:34:12 +02:00
flake8 fixes
This commit is contained in:
parent
63973d6af0
commit
6f6aca1329
1 changed files with 6 additions and 2 deletions
|
|
@ -93,12 +93,14 @@ def test_jsonsplit(fresh_db, delimiter):
|
||||||
],
|
],
|
||||||
pk="id",
|
pk="id",
|
||||||
)
|
)
|
||||||
fn = recipes.jsonsplit
|
|
||||||
if delimiter is not None:
|
if delimiter is not None:
|
||||||
|
|
||||||
def fn(value):
|
def fn(value):
|
||||||
return recipes.jsonsplit(value, delimiter=delimiter)
|
return recipes.jsonsplit(value, delimiter=delimiter)
|
||||||
|
|
||||||
|
else:
|
||||||
|
fn = recipes.jsonsplit
|
||||||
|
|
||||||
fresh_db["example"].convert("tags", fn)
|
fresh_db["example"].convert("tags", fn)
|
||||||
assert list(fresh_db["example"].rows) == [
|
assert list(fresh_db["example"].rows) == [
|
||||||
{"id": 1, "tags": '["foo", "bar"]'},
|
{"id": 1, "tags": '["foo", "bar"]'},
|
||||||
|
|
@ -121,11 +123,13 @@ def test_jsonsplit_type(fresh_db, type, expected):
|
||||||
],
|
],
|
||||||
pk="id",
|
pk="id",
|
||||||
)
|
)
|
||||||
fn = recipes.jsonsplit
|
|
||||||
if type is not None:
|
if type is not None:
|
||||||
|
|
||||||
def fn(value):
|
def fn(value):
|
||||||
return recipes.jsonsplit(value, type=type)
|
return recipes.jsonsplit(value, type=type)
|
||||||
|
|
||||||
|
else:
|
||||||
|
fn = recipes.jsonsplit
|
||||||
|
|
||||||
fresh_db["example"].convert("records", fn)
|
fresh_db["example"].convert("records", fn)
|
||||||
assert json.loads(fresh_db["example"].get(1)["records"]) == expected
|
assert json.loads(fresh_db["example"].get(1)["records"]) == expected
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue