mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 15:38:55 +01:00
Fix CLI tests as config_file path made absolute during CLI parsing
This commit is contained in:
parent
fad2f3a2e7
commit
fd952e7273
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue