Skip to content

Commit 08819ce

Browse files
remove unused commmented out tests (Azure#22226)
1 parent fb96938 commit 08819ce

File tree

4 files changed

+0
-267
lines changed

4 files changed

+0
-267
lines changed

sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze.py

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -461,75 +461,6 @@ def test_poller_metadata(self, client):
461461
assert poller.total_actions_count == 1
462462
assert poller.id
463463

464-
### TODO: Commenting out language tests. Right now analyze only supports language 'en', so no point to these tests yet
465-
466-
# @TextAnalyticsPreparer()
467-
# @TextAnalyticsClientPreparer()
468-
@recorded_by_proxy
469-
# def test_whole_batch_language_hint(self, client):
470-
# def callback(resp):
471-
# language_str = "\"language\": \"fr\""
472-
# if resp.http_request.body:
473-
# language = resp.http_request.body.count(language_str)
474-
# assert language == 3
475-
476-
# docs = [
477-
# u"This was the best day of my life.",
478-
# u"I did not like the hotel we stayed at. It was too expensive.",
479-
# u"The restaurant was not as good as I hoped."
480-
# ]
481-
482-
# response = list(client.begin_analyze_actions(
483-
# docs,
484-
# actions=[
485-
# RecognizeEntitiesAction(),
486-
# ExtractKeyPhrasesAction(),
487-
# RecognizePiiEntitiesAction()
488-
# ],
489-
# language="fr",
490-
# polling_interval=self._interval(),
491-
# raw_response_hook=callback
492-
# ).result())
493-
494-
# for document_result in response:
495-
# for doc in document_result.document_results:
496-
# assert not doc.is_error
497-
498-
# @TextAnalyticsPreparer()
499-
# @TextAnalyticsClientPreparer(client_kwargs={
500-
# "default_language": "en"
501-
# })
502-
# def test_whole_batch_language_hint_and_obj_per_item_hints(self, client):
503-
# def callback(resp):
504-
# pass
505-
# # if resp.http_request.body:
506-
# # language_str = "\"language\": \"es\""
507-
# # language = resp.http_request.body.count(language_str)
508-
# # assert language == 2
509-
# # language_str = "\"language\": \"en\""
510-
# # language = resp.http_request.body.count(language_str)
511-
# # assert language == 1
512-
513-
# docs = [
514-
# TextDocumentInput(id="1", text="I should take my cat to the veterinarian.", language="es"),
515-
# TextDocumentInput(id="2", text="Este es un document escrito en Español.", language="es"),
516-
# TextDocumentInput(id="3", text="猫は幸せ"),
517-
# ]
518-
519-
# response = list(client.begin_analyze_actions(
520-
# docs,
521-
# actions=[
522-
# RecognizeEntitiesAction(),
523-
# ExtractKeyPhrasesAction(),
524-
# RecognizePiiEntitiesAction()
525-
# ],
526-
# polling_interval=self._interval(),
527-
# ).result())
528-
529-
# for document_result in response:
530-
# for doc in document_result.document_results:
531-
# assert not doc.is_error
532-
533464
@TextAnalyticsPreparer()
534465
@TextAnalyticsClientPreparer()
535466
@recorded_by_proxy

sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -521,98 +521,6 @@ async def test_poller_metadata(self, client):
521521
assert poller.total_actions_count == 1
522522
assert poller.id
523523

524-
### TODO: Commenting out language tests. Right now analyze only supports language 'en', so no point to these tests yet
525-
526-
# @TextAnalyticsPreparer()
527-
# @TextAnalyticsClientPreparer()
528-
# @recorded_by_proxy_async
529-
# async def test_whole_batch_language_hint(self, client):
530-
# def callback(resp):
531-
# language_str = "\"language\": \"fr\""
532-
# if resp.http_request.body:
533-
# language = resp.http_request.body.count(language_str)
534-
# assert language == 3
535-
536-
# docs = [
537-
# u"This was the best day of my life.",
538-
# u"I did not like the hotel we stayed at. It was too expensive.",
539-
# u"The restaurant was not as good as I hoped."
540-
# ]
541-
542-
# async with client:
543-
# response = await (await client.begin_analyze_actions(
544-
# docs,
545-
# actions=[
546-
# RecognizeEntitiesAction(),
547-
# ExtractKeyPhrasesAction(),
548-
# RecognizePiiEntitiesAction()
549-
# ],
550-
# language="fr",
551-
# polling_interval=self._interval(),
552-
# raw_response_hook=callback
553-
# )).result()
554-
555-
# async for action_result in response:
556-
# for doc in action_result.document_results:
557-
# assert not doc.is_error
558-
559-
560-
# @TextAnalyticsPreparer()
561-
# @TextAnalyticsClientPreparer(client_kwargs={
562-
# "default_language": "en"
563-
# })
564-
# async def test_whole_batch_language_hint_and_obj_per_item_hints(self, client):
565-
# def callback(resp):
566-
# if resp.http_request.body:
567-
# language_str = "\"language\": \"es\""
568-
# language = resp.http_request.body.count(language_str)
569-
# assert language == 2
570-
# language_str = "\"language\": \"en\""
571-
# language = resp.http_request.body.count(language_str)
572-
# assert language == 1
573-
574-
# docs = [
575-
# TextDocumentInput(id="1", text="I should take my cat to the veterinarian.", language="es"),
576-
# TextDocumentInput(id="2", text="Este es un document escrito en Español.", language="es"),
577-
# TextDocumentInput(id="3", text="猫は幸せ"),
578-
# ]
579-
580-
# async with client:
581-
# response = await (await client.begin_analyze_actions(
582-
# docs,
583-
# actions=[
584-
# RecognizeEntitiesAction(),
585-
# ExtractKeyPhrasesAction(),
586-
# RecognizePiiEntitiesAction()
587-
# ],
588-
# language="en",
589-
# polling_interval=self._interval()
590-
# )).result()
591-
592-
# async for action_result in response:
593-
# for doc in action_result.document_results:
594-
# assert not doc.is_error
595-
596-
# @TextAnalyticsPreparer()
597-
# @TextAnalyticsClientPreparer()
598-
# @recorded_by_proxy_async
599-
# async def test_invalid_language_hint_method(self, client):
600-
# async with client:
601-
# response = await (await client.begin_analyze_actions(
602-
# ["This should fail because we're passing in an invalid language hint"],
603-
# language="notalanguage",
604-
# actions=[
605-
# RecognizeEntitiesAction(),
606-
# ExtractKeyPhrasesAction(),
607-
# RecognizePiiEntitiesAction()
608-
# ],
609-
# polling_interval=self._interval()
610-
# )).result()
611-
612-
# async for action_result in response:
613-
# for doc in action_result.document_results:
614-
# assert doc.is_error
615-
616524
@TextAnalyticsPreparer()
617525
@TextAnalyticsClientPreparer()
618526
@recorded_by_proxy_async

sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare.py

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -291,56 +291,6 @@ def callback(pipeline_response, deserialized, _):
291291
).result()
292292
assert res == "cls result"
293293

294-
"""Commenting out multi page tests until service returns multiple pages"""
295-
296-
# @TextAnalyticsPreparer()
297-
# @TextAnalyticsClientPreparer()
298-
# @recorded_by_proxy
299-
# def test_multiple_pages_of_results_returned_successfully(self, client):
300-
# single_doc = "hello world"
301-
# docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))]
302-
# # Service now only accepts 10 documents for a job, and since the current default server-side value
303-
# # for records per page is 20, pagination logic will never be activated. This is intended to change
304-
# # in the future but for now this test actually won't hit the pagination logic now.
305-
306-
# result = client.begin_analyze_healthcare_entities(docs, show_stats=True, polling_interval=self._interval()).result()
307-
# response = list(result)
308-
309-
# assert len(docs) == len(response)
310-
# assert result.statistics is not None
311-
312-
# for (idx, doc) in enumerate(response):
313-
# assert docs[idx]["id"] == doc.id
314-
# assert doc.statistics is not None
315-
316-
# @TextAnalyticsPreparer()
317-
# @TextAnalyticsClientPreparer()
318-
# @recorded_by_proxy
319-
# def test_multiple_pages_of_results_with_errors_returned_successfully(self, client):
320-
# single_doc = "hello world"
321-
# docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 9)))]
322-
# docs.append({"id": "9", "text": ""})
323-
# # Service now only accepts 10 documents for a job, and since the current default server-side value
324-
# # for records per page is 20, pagination logic will never be activated. This is intended to change
325-
# # in the future but for now this test actually won't hit the pagination logic now.
326-
327-
328-
# result = client.begin_analyze_healthcare_entities(docs, show_stats=True, polling_interval=self._interval()).result()
329-
# response = list(result)
330-
331-
# assert len(docs) == len(response)
332-
# assert result.statistics is not None
333-
334-
# for (idx, doc) in enumerate(response):
335-
# assert docs[idx]["id"] == doc.id
336-
337-
# if doc.id == "9":
338-
# assert doc.is_error
339-
340-
# else:
341-
# assert not doc.is_error
342-
# assert doc.statistics is not None
343-
344294
@TextAnalyticsPreparer()
345295
@TextAnalyticsClientPreparer()
346296
@recorded_by_proxy

sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_healthcare_async.py

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -317,61 +317,6 @@ def callback(pipeline_response, deserialized, _):
317317
)).result()
318318
assert res == "cls result"
319319

320-
"""Commenting out multi page tests until service returns multiple pages"""
321-
322-
# @TextAnalyticsPreparer()
323-
# @TextAnalyticsClientPreparer()
324-
# @recorded_by_proxy_async
325-
# async def test_multiple_pages_of_results_returned_successfully(self, client):
326-
# single_doc = "hello world"
327-
# docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))]
328-
# # Service now only accepts 10 documents for a job, and since the current default server-side value
329-
# # for records per page is 20, pagination logic will never be activated. This is intended to change
330-
# # in the future but for now this test actually won't hit the pagination logic now.
331-
332-
# async with client:
333-
# poller = await client.begin_analyze_healthcare_entities(docs, show_stats=True, polling_interval=self._interval())
334-
# result = await poller.result()
335-
# response = []
336-
# async for r in result:
337-
# response.append(r)
338-
339-
# assert len(docs) == len(response)
340-
# assert result.statistics is not None
341-
342-
# for (idx, doc) in enumerate(response):
343-
# assert docs[idx]["id"] == doc.id
344-
345-
# @TextAnalyticsPreparer()
346-
# @TextAnalyticsClientPreparer()
347-
# @recorded_by_proxy_async
348-
# async def test_multiple_pages_of_results_with_errors_returned_successfully(self, client):
349-
# single_doc = "hello world"
350-
# docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 9)))]
351-
# docs.append({"id": "9", "text": ""})
352-
# # Service now only accepts 10 documents for a job, and since the current default server-side value
353-
# # for records per page is 20, pagination logic will never be activated. This is intended to change
354-
# # in the future but for now this test actually won't hit the pagination logic now.
355-
356-
# async with client:
357-
# result = await (await client.begin_analyze_healthcare_entities(docs, show_stats=True, polling_interval=self._interval())).result()
358-
# response = []
359-
# async for r in result:
360-
# response.append(r)
361-
362-
# assert len(docs) == len(response)
363-
# assert result.statistics is not None
364-
365-
# for (idx, doc) in enumerate(response):
366-
# assert docs[idx]["id"] == doc.id
367-
368-
# if doc.id == "9":
369-
# assert doc.is_error
370-
371-
# else:
372-
# assert not doc.is_error
373-
# assert doc.statistics is not None
374-
375320
@TextAnalyticsPreparer()
376321
@TextAnalyticsClientPreparer()
377322
@recorded_by_proxy_async
@@ -389,7 +334,6 @@ async def test_cancellation(self, client):
389334
except HttpResponseError:
390335
pass # expected if the operation was already in a terminal state.
391336

392-
393337
@TextAnalyticsPreparer()
394338
@TextAnalyticsClientPreparer()
395339
@recorded_by_proxy_async

0 commit comments

Comments
 (0)