Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update test_aifs.py with optimizations #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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)