From 0cf3ac688953fa550ef8832137c6cb69c1a354b8 Mon Sep 17 00:00:00 2001 From: Hazal Date: Thu, 9 Jan 2025 11:31:49 +0000 Subject: [PATCH] removed `/v1/extract-keywords` endpoint (#33) --- spacy_keyword_extraction_api/api_router.py | 6 ------ tests/unit_test/api_router_test.py | 10 ---------- tests/unit_test/main_test.py | 6 ------ 3 files changed, 22 deletions(-) diff --git a/spacy_keyword_extraction_api/api_router.py b/spacy_keyword_extraction_api/api_router.py index e247921..71748e8 100644 --- a/spacy_keyword_extraction_api/api_router.py +++ b/spacy_keyword_extraction_api/api_router.py @@ -106,12 +106,6 @@ def create_api_router( ) -> APIRouter: router = APIRouter() - @router.get('/v1/extract-keywords') - def extract_keywords(text: str) -> KeywordsResponseTypedDict: - return { - 'keywords': keyword_extractor.get_extracted_keywords_for_text(text) - } - @router.post( '/v1/batch-extract-keywords', responses=EXAMPLE_BATCH_KEYWORDS_RESPONSES_BY_STATUS_CODE_DICT diff --git a/tests/unit_test/api_router_test.py b/tests/unit_test/api_router_test.py index 227153e..2b2e46b 100644 --- a/tests/unit_test/api_router_test.py +++ b/tests/unit_test/api_router_test.py @@ -59,16 +59,6 @@ def test_should_remove_duplicates(self): class TestExtractKeyword: - def test_should_return_extracted_keywords( - self, - keyword_extractor: KeywordExtractor - ): - client = create_test_client(keyword_extractor=keyword_extractor) - response = client.get('/v1/extract-keywords', params={'text': TEXT_1}) - assert response.json() == { - 'keywords': keyword_extractor.get_extracted_keywords_for_text(TEXT_1) - } - def test_should_return_batch_extracted_keywords( self, keyword_extractor: KeywordExtractor diff --git a/tests/unit_test/main_test.py b/tests/unit_test/main_test.py index 7760a28..bf286b2 100644 --- a/tests/unit_test/main_test.py +++ b/tests/unit_test/main_test.py @@ -29,9 +29,3 @@ def test_read_main(): client = TestClient(create_app()) response = client.get("/") assert response.status_code == 200 - - -def test_extract_keywords_endpoint_is_available(): - client = TestClient(create_app()) - response = client.get("/v1/extract-keywords", params={'text': 'some text'}) - assert response.status_code == 200