Skip to content

Commit

Permalink
Update test_search.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cjb873 authored Dec 4, 2023
1 parent ce44265 commit 4c7378a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions zeek-package-website/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
import pytest
import pickle
from app.api.search import search as s
sys.path.insert(0, 'tests')




class TestRank:

query = "http"
documents = []
project_dir = os.path.dirname(os.path.abspath(__file__))
json_files_dir = os.path.join(project_dir, "../app/api/search/json_files")
json_files_dir = os.path.join(project_dir, "app/api/search/json_files")
document_names = os.listdir(json_files_dir)
for name in document_names:
text_file = open(os.path.join(json_files_dir, name), "r")
Expand All @@ -23,7 +20,7 @@ class TestRank:
documents.append(data)
text_file.close()

file = open("http_rankings", "rb")
file = open("tests/http_rankings", "rb")
saved_rankings = pickle.load(file)
file.close()
rankings = s.rank(documents, query)
Expand Down

0 comments on commit 4c7378a

Please sign in to comment.