mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-17 14:04:11 +02:00
Docs for --save and --dump plus made SQL optional for those, refs #273
This commit is contained in:
parent
88b46288b3
commit
435096c563
3 changed files with 39 additions and 4 deletions
|
|
@ -34,10 +34,11 @@ def test_memory_csv(tmpdir, sql_from, use_stdin):
|
|||
)
|
||||
|
||||
|
||||
def test_memory_dump():
|
||||
@pytest.mark.parametrize("extra_args", ([], ["select 1"]))
|
||||
def test_memory_dump(extra_args):
|
||||
result = CliRunner().invoke(
|
||||
cli.cli,
|
||||
["memory", "-", "select 1", "--dump"],
|
||||
["memory", "-"] + extra_args + ["--dump"],
|
||||
input="id,name\n1,Cleo\n2,Bants",
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
|
|
@ -55,11 +56,12 @@ def test_memory_dump():
|
|||
)
|
||||
|
||||
|
||||
def test_memory_save(tmpdir):
|
||||
@pytest.mark.parametrize("extra_args", ([], ["select 1"]))
|
||||
def test_memory_save(tmpdir, extra_args):
|
||||
save_to = str(tmpdir / "save.db")
|
||||
result = CliRunner().invoke(
|
||||
cli.cli,
|
||||
["memory", "-", "select 1", "--save", save_to],
|
||||
["memory", "-"] + extra_args + ["--save", save_to],
|
||||
input="id,name\n1,Cleo\n2,Bants",
|
||||
)
|
||||
assert result.exit_code == 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue