Skip to content

Commit f8ff243

Browse files
authored
Merge pull request #28 from AlexNikic/main
Exposed harmonydata/harmony#75 to the API
2 parents f2d84d8 + ff9a4fc commit f8ff243

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

harmony_api/routers/text_router.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
CacheResponse,
4848
SearchInstrumentsResponse,
4949
)
50+
from harmony.util.url_loader import load_instruments_from_url
5051

5152
from harmony.schemas.enums.clustering_algorithms import ClusteringAlgorithm
5253
from harmony_api import helpers, dependencies, constants
@@ -435,3 +436,9 @@ def search_instruments(
435436
]
436437

437438
return SearchInstrumentsResponse(instruments=instruments)
439+
440+
@router.get(
441+
path="/get_instruments_from_url", status_code=status.HTTP_200_OK, response_model_exclude_none=True
442+
)
443+
def get_instruments_from_url(url: str) -> List[Instrument]:
444+
return load_instruments_from_url(url)

tests/remote_tests/test_match_remote.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
class TestMatch(unittest.TestCase):
124124

125125
def test_gad_7_correct_size_dictionary_response(self):
126-
self.assertEqual(7, len(response.json()))
126+
self.assertEqual(8, len(response.json()))
127127

128128
def test_gad_7_first_question_conserved(self):
129129
self.assertEqual("Feeling nervous, anxious, or on edge", response.json()["questions"][0]["question_text"])

0 commit comments

Comments
 (0)