Skip to content

Commit

Permalink
Fix sys path append statements by making paths absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
tanya-borisova committed Apr 10, 2024
1 parent 1461250 commit 1ecc1f5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
7 changes: 6 additions & 1 deletion code/tests/test_AddURLEmbeddings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import sys
import os
from unittest import mock
import azure.functions as func

sys.path.append("backend/batch")

function_app_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../backend/batch")
)
sys.path.append(function_app_path)

from backend.batch.AddURLEmbeddings import do_add_url_embeddings # noqa: E402

Expand Down
6 changes: 5 additions & 1 deletion code/tests/test_BatchGetConversationResponse.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import sys
import os
from unittest.mock import patch, Mock, ANY
import json

sys.path.append("backend/batch/")
function_app_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../backend/batch")
)
sys.path.append(function_app_path)

from backend.batch.GetConversationResponse import ( # noqa: E402
do_get_conversation_response,
Expand Down
8 changes: 7 additions & 1 deletion code/tests/test_BatchPushResults.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import sys
import os
from unittest.mock import patch, Mock
from azure.functions import QueueMessage

sys.path.append("backend/batch/")

function_app_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../backend/batch")
)
sys.path.append(function_app_path)

from backend.batch.BatchPushResults import do_batch_push_results # noqa: E402
from backend.batch.BatchPushResults import _get_file_name_from_message # noqa: E402

Expand Down
7 changes: 6 additions & 1 deletion code/tests/test_BatchStartProcessing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import sys
import os
from unittest.mock import patch, Mock

sys.path.append("backend/batch")
function_app_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "../backend/batch")
)
sys.path.append(function_app_path)

from backend.batch.BatchStartProcessing import do_batch_start_processing # noqa: E402


Expand Down

0 comments on commit 1ecc1f5

Please sign in to comment.