Skip to content

Commit

Permalink
Allow tests to run correctly even when Harmony Python library is cont…
Browse files Browse the repository at this point in the history
…ained within harmonyapi repo as a submodule
  • Loading branch information
woodthom2 committed May 13, 2024
1 parent 66c3292 commit 1e891a3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/test_convert_excel_openpyxl.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
'''

import sys
import unittest

sys.path.append("../src")

from harmony import convert_excel_to_instruments
from harmony.schemas.requests.text import RawFile

Expand Down
3 changes: 3 additions & 0 deletions tests/test_convert_excel_xlsxwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
'''

import sys
import unittest

from harmony import convert_excel_to_instruments
from harmony.schemas.requests.text import RawFile

sys.path.append("../src")

xlsx_gad_7_2_questions = RawFile.parse_obj({
"file_id": "1d66bce4b80c4b0eaefe33f00cddedef",
"file_name": "GAD-7.xlsx",
Expand Down
4 changes: 4 additions & 0 deletions tests/test_convert_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
'''

import sys
import unittest

sys.path.append("../src")

from harmony import convert_pdf_to_instruments
from harmony.schemas.requests.text import RawFile
from harmony import download_models
Expand All @@ -40,6 +43,7 @@

download_models()


class TestConvertPdf(unittest.TestCase):

def test_single_instrument(self):
Expand Down
3 changes: 3 additions & 0 deletions tests/test_convert_text.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
'''

import sys
import unittest

sys.path.append("../src")

from harmony import convert_text_to_instruments
from harmony.schemas.requests.text import RawFile

Expand Down
7 changes: 5 additions & 2 deletions tests/test_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
'''

import sys
import unittest

sys.path.append("../src")

from harmony import match_instruments
from harmony.schemas.requests.text import Instrument, Question

Expand All @@ -36,8 +39,8 @@

questions_pt = [Question(
question_text="Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?"),
Question(
question_text="Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?")]
Question(
question_text="Durante as últimas 2 semanas, com que freqüência você foi incomodado/a pelos problemas abaixo?")]
instrument_pt = Instrument(questions=questions_pt, language="pt")

instrument_1 = Instrument.parse_obj({
Expand Down
3 changes: 3 additions & 0 deletions tests/test_match_mhc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@
'''

import sys
import unittest

sys.path.append("../src")

import numpy as np
from sentence_transformers import SentenceTransformer

Expand Down
2 changes: 2 additions & 0 deletions tests/test_negator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
'''

import sys
import unittest

sys.path.append("../src")
from harmony.matching.negator import negate


Expand Down

0 comments on commit 1e891a3

Please sign in to comment.