From 4c7378aec552c0888f82ec25ef1b6000073a9f61 Mon Sep 17 00:00:00 2001 From: Cody Beck Date: Mon, 4 Dec 2023 15:39:59 -0700 Subject: [PATCH] Update test_search.py --- zeek-package-website/tests/test_search.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zeek-package-website/tests/test_search.py b/zeek-package-website/tests/test_search.py index 31cdb6b..bc813e4 100644 --- a/zeek-package-website/tests/test_search.py +++ b/zeek-package-website/tests/test_search.py @@ -3,9 +3,6 @@ import pytest import pickle from app.api.search import search as s -sys.path.insert(0, 'tests') - - class TestRank: @@ -13,7 +10,7 @@ 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") @@ -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)