mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Add --ignore to create-index as alias of --if-not-exists, refs #450
This commit is contained in:
parent
40b6947255
commit
2c77f4467e
3 changed files with 13 additions and 13 deletions
|
|
@ -214,13 +214,12 @@ def test_create_index(db_path):
|
|||
] == db["Gosh2"].indexes
|
||||
# Trying to create the same index should fail
|
||||
assert 0 != CliRunner().invoke(cli.cli, create_index_unique_args).exit_code
|
||||
# ... unless we use --if-not-exists
|
||||
assert (
|
||||
0
|
||||
== CliRunner()
|
||||
.invoke(cli.cli, create_index_unique_args + ["--if-not-exists"])
|
||||
.exit_code
|
||||
)
|
||||
# ... unless we use --if-not-exists or --ignore
|
||||
for option in ("--if-not-exists", "--ignore"):
|
||||
assert (
|
||||
CliRunner().invoke(cli.cli, create_index_unique_args + [option]).exit_code
|
||||
== 0
|
||||
)
|
||||
|
||||
|
||||
def test_create_index_analyze(db_path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue