diff --git a/.env.template b/.env.template index 01b4992..ec6cf6d 100644 --- a/.env.template +++ b/.env.template @@ -1,3 +1,4 @@ BING_SEARCH_KEY = BING_ENDPOINT = CACHE_PATH = +OUTPUT_FOLDER = diff --git a/finesse/accuracy_functions.py b/finesse/accuracy_functions.py index ff674ec..8f71f03 100644 --- a/finesse/accuracy_functions.py +++ b/finesse/accuracy_functions.py @@ -2,12 +2,15 @@ import datetime import csv import os +import re + +from dotenv import load_dotenv from collections import namedtuple -import regex as re + from finesse.bing_search import BingSearch -from dotenv import load_dotenv -OUTPUT_FOLDER = "./finesse/output" +load_dotenv() +OUTPUT_FOLDER = os.getenv("OUTPUT_FOLDER","./finesse/output") AccuracyResult = namedtuple("AccuracyResult", ["position", "total_pages", "score"]) def calculate_accuracy(responses_url: list[str], expected_url: list | str) -> AccuracyResult: diff --git a/finesse/bing_search.py b/finesse/bing_search.py index c183949..ac8b60d 100644 --- a/finesse/bing_search.py +++ b/finesse/bing_search.py @@ -1,7 +1,8 @@ -from azure.cognitiveservices.search.websearch import WebSearchClient -from msrest.authentication import CognitiveServicesCredentials import time import statistics + +from azure.cognitiveservices.search.websearch import WebSearchClient +from msrest.authentication import CognitiveServicesCredentials from joblib import Memory diff --git a/finesse/finesse_test.py b/finesse/finesse_test.py index c5bbd91..ea4cc31 100644 --- a/finesse/finesse_test.py +++ b/finesse/finesse_test.py @@ -1,9 +1,11 @@ -from locust import HttpUser, task, events -from jsonreader import JSONReader import os import json + +from locust import HttpUser, task, events + from accuracy_functions import save_to_markdown, save_to_csv, calculate_accuracy, update_dict_bing_data from host import is_host_up +from jsonreader import JSONReader global_test_data = dict() settings = dict() diff --git a/requirements.txt b/requirements.txt index 636df26..92c606b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ locust -regex python-dotenv azure-cognitiveservices-search-websearch msrest