Skip to content

Commit

Permalink
Test error on missing fields in ContentConfig pulled from Khoj.yml
Browse files Browse the repository at this point in the history
Resolves #9
  • Loading branch information
debanjum committed Mar 2, 2023
1 parent b6dbe4d commit c823f46
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/test_rawconfig.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# External Packages
import pytest

# Internal Packages
from khoj.utils.rawconfig import TextContentConfig, ImageContentConfig


# Test
# ----------------------------------------------------------------------------------------------------
def test_input_file_or_filter_required_in_text_content_config():
# Act
with pytest.raises(ValueError):
TextContentConfig(
input_files=None,
input_filter=None,
compressed_jsonl="notes.jsonl",
embeddings_file="note_embeddings.pt",
)


# ----------------------------------------------------------------------------------------------------
def test_input_filter_or_directories_required_in_image_content_config():
# Act
with pytest.raises(ValueError):
ImageContentConfig(
input_directories=None,
input_filter=None,
embeddings_file="note_embeddings.pt",
)

0 comments on commit c823f46

Please sign in to comment.