mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-13 20:14:24 +02:00
Add paths for homebrew on Apple silicon and use those paths when passed in
This commit is contained in:
parent
fc221f9b62
commit
0e4750dff0
4 changed files with 32 additions and 4 deletions
|
|
@ -234,3 +234,30 @@ def test_cli_create_spatial_index(tmpdir):
|
|||
assert 0 == result.exit_code
|
||||
|
||||
assert "idx_locations_geometry" in db.table_names()
|
||||
|
||||
|
||||
def test_cli_create_spatial_index_with_path(tmpdir):
|
||||
# create a rowid table with one column
|
||||
db_path = tmpdir / "spatial.db"
|
||||
db = Database(str(db_path))
|
||||
db.init_spatialite()
|
||||
|
||||
table = db["locations"].create({"name": str})
|
||||
table.add_geometry_column("geometry", "POINT")
|
||||
|
||||
path = find_spatialite()
|
||||
result = CliRunner().invoke(
|
||||
cli,
|
||||
[
|
||||
"create-spatial-index",
|
||||
str(db_path),
|
||||
table.name,
|
||||
"geometry",
|
||||
"--load-extension",
|
||||
path,
|
||||
],
|
||||
)
|
||||
|
||||
assert 0 == result.exit_code
|
||||
|
||||
assert "idx_locations_geometry" in db.table_names()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue