Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions tests/test_aifs.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
from aifs import search
import os

def test_search_this():
def setup_environment():
os.environ['AIFS_MINIMAL_PYTHON_INDEXING'] = 'false'
current_dir_path = os.path.dirname(os.path.realpath(__file__))
query = "test search"
results = search(query, path=current_dir_path)

def run_search_test(query, path):
results = search(query, path=path)
print(results)
assert results

def test_search_this():
setup_environment()
current_dir_path = os.path.dirname(os.path.realpath(__file__))
run_search_test("test search", current_dir_path)

def test_search_desktop():
os.environ['AIFS_MINIMAL_PYTHON_INDEXING'] = 'false'
setup_environment()
desktop_path = os.path.expanduser("~/Desktop")
query = "forest gump"
results = search(query, path=desktop_path)
print(results)
assert results
run_search_test("forest gump", desktop_path)