mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-21 16:34:32 +02:00
parent
2b0cc04c8d
commit
733a67490f
1 changed files with 18 additions and 0 deletions
|
|
@ -156,6 +156,24 @@ def test_memory_csv_encoding(tmpdir, use_stdin):
|
|||
}
|
||||
|
||||
|
||||
def test_memory_csv_headers_only(tmpdir):
|
||||
csv_path = str(tmpdir / "headers_only.csv")
|
||||
with open(csv_path, "w") as fp:
|
||||
fp.write("id,name,age\n")
|
||||
|
||||
result = CliRunner().invoke(
|
||||
cli.cli,
|
||||
["memory", csv_path, "", "--schema"],
|
||||
catch_exceptions=False,
|
||||
)
|
||||
|
||||
assert result.exit_code == 0
|
||||
assert result.output.strip() == (
|
||||
'CREATE VIEW "t1" AS select * from "headers_only";\n'
|
||||
'CREATE VIEW "t" AS select * from "headers_only";'
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("extra_args", ([], ["select 1"]))
|
||||
def test_memory_dump(extra_args):
|
||||
result = CliRunner().invoke(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue