Add new --internal internal.db option, deprecate legacy _internal database

Refs:
- #2157 
---------

Co-authored-by: Simon Willison <swillison@gmail.com>
This commit is contained in:
Alex Garcia 2023-08-28 20:24:23 -07:00 committed by GitHub
commit 92b8bf38c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 108 additions and 90 deletions

View file

@ -154,6 +154,7 @@ def test_metadata_yaml():
ssl_keyfile=None,
ssl_certfile=None,
return_instance=True,
internal=None,
)
client = _TestClient(ds)
response = client.get("/-/metadata.json")
@ -368,3 +369,14 @@ def test_help_settings():
result = runner.invoke(cli, ["--help-settings"])
for setting in SETTINGS:
assert setting.name in result.output
def test_internal_db(tmpdir):
runner = CliRunner()
internal_path = tmpdir / "internal.db"
assert not internal_path.exists()
result = runner.invoke(
cli, ["--memory", "--internal", str(internal_path), "--get", "/"]
)
assert result.exit_code == 0
assert internal_path.exists()