From fd952e72733442444c052786b626acb4494492ea Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 12 Aug 2022 01:47:52 +0300 Subject: [PATCH] Fix CLI tests as config_file path made absolute during CLI parsing --- tests/test_cli.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 7e7531fb..4cbf1209 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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