-
-
Notifications
You must be signed in to change notification settings - Fork 650
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test error on missing fields in ContentConfig pulled from Khoj.yml
Resolves #9
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
) |