mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-31 06:24:21 +02:00
Don't detect types on JSON input to memory, closes #283
This commit is contained in:
parent
ec5174ed40
commit
dc94f4bb8c
3 changed files with 19 additions and 16 deletions
|
|
@ -64,7 +64,7 @@ def test_memory_tsv(tmpdir, use_stdin):
|
|||
|
||||
@pytest.mark.parametrize("use_stdin", (True, False))
|
||||
def test_memory_json(tmpdir, use_stdin):
|
||||
data = '[{"name": "Bants"}, {"name": "Dori", "age": 1}]'
|
||||
data = '[{"name": "Bants"}, {"name": "Dori", "age": 1, "nested": {"nest": 1}}]'
|
||||
if use_stdin:
|
||||
input = data
|
||||
path = "stdin:json"
|
||||
|
|
@ -82,8 +82,8 @@ def test_memory_json(tmpdir, use_stdin):
|
|||
)
|
||||
assert result.exit_code == 0, result.output
|
||||
assert json.loads(result.output.strip()) == [
|
||||
{"rowid": 1, "name": "Bants", "age": None},
|
||||
{"rowid": 2, "name": "Dori", "age": 1},
|
||||
{"name": "Bants", "age": None, "nested": None},
|
||||
{"name": "Dori", "age": 1, "nested": '{"nest": 1}'},
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -107,8 +107,8 @@ def test_memory_json_nl(tmpdir, use_stdin):
|
|||
)
|
||||
assert result.exit_code == 0, result.output
|
||||
assert json.loads(result.output.strip()) == [
|
||||
{"rowid": 1, "name": "Bants"},
|
||||
{"rowid": 2, "name": "Dori"},
|
||||
{"name": "Bants"},
|
||||
{"name": "Dori"},
|
||||
]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue