mirror of
https://github.com/lancedb/lancedb.git
synced 2025-12-23 05:19:58 +00:00
Co-authored-by: Lance Release <lance-dev@lancedb.com> Co-authored-by: Rob Meng <rob.xu.meng@gmail.com> Co-authored-by: Will Jones <willjones127@gmail.com> Co-authored-by: Chang She <759245+changhiskhan@users.noreply.github.com> Co-authored-by: rmeng <rob@lancedb.com> Co-authored-by: Chang She <chang@lancedb.com> Co-authored-by: Rok Mihevc <rok@mihevc.org>
36 lines
973 B
Python
36 lines
973 B
Python
from click.testing import CliRunner
|
|
|
|
from lancedb.cli.cli import cli
|
|
from lancedb.utils import CONFIG
|
|
|
|
|
|
def test_entry():
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli)
|
|
assert result.exit_code == 0 # Main check
|
|
assert "lancedb" in result.output.lower() # lazy check
|
|
|
|
|
|
def test_diagnostics():
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli, ["diagnostics", "--disabled"])
|
|
assert result.exit_code == 0 # Main check
|
|
assert CONFIG["diagnostics"] == False
|
|
|
|
result = runner.invoke(cli, ["diagnostics", "--enabled"])
|
|
assert result.exit_code == 0 # Main check
|
|
assert CONFIG["diagnostics"] == True
|
|
|
|
|
|
def test_config():
|
|
runner = CliRunner()
|
|
result = runner.invoke(cli, ["config"])
|
|
assert result.exit_code == 0 # Main check
|
|
cfg = CONFIG.copy()
|
|
cfg.pop("uuid")
|
|
for (
|
|
item,
|
|
_,
|
|
) in cfg.items(): # check for keys only as formatting is subject to change
|
|
assert item in result.output
|