mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Fix CLI tests as config_file path made absolute during CLI parsing
This commit is contained in:
@@ -7,6 +7,7 @@ import pytest
|
||||
|
||||
# Internal Packages
|
||||
from src.utils.cli import cli
|
||||
from src.utils.helpers import resolve_absolute_path
|
||||
|
||||
|
||||
# Test
|
||||
@@ -16,7 +17,7 @@ def test_cli_minimal_default():
|
||||
actual_args = cli([])
|
||||
|
||||
# Assert
|
||||
assert actual_args.config_file == Path('~/.khoj/khoj.yml')
|
||||
assert actual_args.config_file == resolve_absolute_path(Path('~/.khoj/khoj.yml'))
|
||||
assert actual_args.regenerate == False
|
||||
assert actual_args.no_gui == False
|
||||
assert actual_args.verbose == 0
|
||||
@@ -30,7 +31,7 @@ def test_cli_invalid_config_file_path():
|
||||
actual_args = cli([f'-c={non_existent_config_file}'])
|
||||
|
||||
# Assert
|
||||
assert actual_args.config_file == Path(non_existent_config_file)
|
||||
assert actual_args.config_file == resolve_absolute_path(non_existent_config_file)
|
||||
assert actual_args.config == None
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------
|
||||
@@ -42,7 +43,7 @@ def test_cli_config_from_file():
|
||||
'-vvv'])
|
||||
|
||||
# Assert
|
||||
assert actual_args.config_file == Path('tests/data/config.yml')
|
||||
assert actual_args.config_file == resolve_absolute_path(Path('tests/data/config.yml'))
|
||||
assert actual_args.no_gui == True
|
||||
assert actual_args.regenerate == True
|
||||
assert actual_args.config is not None
|
||||
|
||||
Reference in New Issue
Block a user