mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 10:53:02 +01:00
Clean-up generated file after image search test run
- Clean-up unused imports in test files
This commit is contained in:
parent
f97308bef2
commit
ed8d432fdd
3 changed files with 6 additions and 5 deletions
|
@ -2,9 +2,6 @@
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from random import random
|
from random import random
|
||||||
|
|
||||||
# External Modules
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
# Internal Packages
|
# Internal Packages
|
||||||
from src.utils.cli import cli
|
from src.utils.cli import cli
|
||||||
from src.utils.helpers import resolve_absolute_path
|
from src.utils.helpers import resolve_absolute_path
|
||||||
|
|
|
@ -48,8 +48,13 @@ def test_image_search(content_config: ContentConfig, search_config: SearchConfig
|
||||||
image_files_url='/static/images',
|
image_files_url='/static/images',
|
||||||
count=1)
|
count=1)
|
||||||
|
|
||||||
actual_image = Image.open(output_directory.joinpath(Path(results[0]["entry"]).name))
|
actual_image_path = output_directory.joinpath(Path(results[0]["entry"]).name)
|
||||||
|
actual_image = Image.open(actual_image_path)
|
||||||
expected_image = Image.open(content_config.image.input_directories[0].joinpath(expected_image_name))
|
expected_image = Image.open(content_config.image.input_directories[0].joinpath(expected_image_name))
|
||||||
|
|
||||||
# Assert
|
# Assert
|
||||||
assert expected_image == actual_image
|
assert expected_image == actual_image
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
# Delete the image files copied to results directory
|
||||||
|
actual_image_path.unlink()
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Standard Packages
|
# Standard Packages
|
||||||
import json
|
import json
|
||||||
from posixpath import split
|
|
||||||
|
|
||||||
# Internal Packages
|
# Internal Packages
|
||||||
from src.processor.org_mode.org_to_jsonl import convert_org_entries_to_jsonl, extract_org_entries
|
from src.processor.org_mode.org_to_jsonl import convert_org_entries_to_jsonl, extract_org_entries
|
||||||
|
|
Loading…
Reference in a new issue