This commit is contained in:
Guillermo Garcia 2026-07-13 08:52:05 +00:00 committed by GitHub
commit c51736edd7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 43 additions and 6 deletions

View file

@ -2503,6 +2503,30 @@ def test_attach(tmpdir):
]
def test_attach_filepath_with_apostrophe(tmpdir):
foo_path = str(tmpdir / "foo.db")
bar_dir = tmpdir / "has'apostrophe"
bar_dir.mkdir()
bar_path = str(bar_dir / "bar.db")
db = Database(foo_path)
with db.conn:
db["foo"].insert({"id": 1, "text": "foo"})
db2 = Database(bar_path)
with db2.conn:
db2["bar"].insert({"id": 1, "text": "bar"})
db.attach("bar", bar_path)
sql = "select * from foo union all select * from bar.bar"
result = CliRunner().invoke(
cli.cli,
[foo_path, "--attach", "bar", bar_path, sql],
catch_exceptions=False,
)
assert json.loads(result.output) == [
{"id": 1, "text": "foo"},
{"id": 1, "text": "bar"},
]
def test_csv_insert_bom(tmpdir):
db_path = str(tmpdir / "test.db")
bom_csv_path = str(tmpdir / "bom.csv")