mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 13:18:18 +00:00
Test error on missing fields in ContentConfig pulled from Khoj.yml
Resolves #9
This commit is contained in:
29
tests/test_rawconfig.py
Normal file
29
tests/test_rawconfig.py
Normal file
@@ -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",
|
||||
)
|
||||
Reference in New Issue
Block a user