mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-29 05:14:28 +02:00
Test for index-foreign-keys command
This commit is contained in:
parent
61164d98cf
commit
1e917efe31
1 changed files with 10 additions and 0 deletions
|
|
@ -310,6 +310,16 @@ def test_add_column_foreign_key(db_path):
|
||||||
assert "table 'bobcats' does not exist" in str(result.exception)
|
assert "table 'bobcats' does not exist" in str(result.exception)
|
||||||
|
|
||||||
|
|
||||||
|
def test_index_foreign_keys(db_path):
|
||||||
|
test_add_column_foreign_key(db_path)
|
||||||
|
db = Database(db_path)
|
||||||
|
assert [] == db["books"].indexes
|
||||||
|
result = CliRunner().invoke(cli.cli, ["index-foreign-keys", db_path])
|
||||||
|
assert [["author_id"], ["author_name_ref"]] == [
|
||||||
|
i.columns for i in db["books"].indexes
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
def test_enable_fts(db_path):
|
def test_enable_fts(db_path):
|
||||||
assert None == Database(db_path)["Gosh"].detect_fts()
|
assert None == Database(db_path)["Gosh"].detect_fts()
|
||||||
result = CliRunner().invoke(
|
result = CliRunner().invoke(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue