Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[text analytics] fix health tests #16586

Merged
merged 1 commit into from
Feb 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def test_multiple_pages_of_results_with_errors_returned_successfully(self, clien
self.assertIsNotNone(doc.statistics)

@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": os.environ.get("AZURE_TEXT_ANALYTICS_KEY"), "text_analytics_account": os.environ.get("AZURE_TEXT_ANALYTICS_ENDPOINT")})
@TextAnalyticsClientPreparer()
def test_cancellation(self, client):
single_doc = "hello world"
docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))]
Expand Down Expand Up @@ -641,7 +641,7 @@ def test_explicit_set_string_index_type(self, client):
poller.result()

@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": os.environ.get("AZURE_TEXT_ANALYTICS_KEY"), "text_analytics_account": os.environ.get("AZURE_TEXT_ANALYTICS_ENDPOINT")})
@TextAnalyticsClientPreparer()
def test_bidirectional_relation_type(self, client):
result = list(client.begin_analyze_healthcare_entities(
documents=["The patient was diagnosed with Parkinsons Disease (PD)"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -732,14 +732,14 @@ async def test_multiple_pages_of_results_with_errors_returned_successfully(self,
self.assertIsNotNone(doc.statistics)

@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": os.environ.get("AZURE_TEXT_ANALYTICS_KEY"), "text_analytics_account": os.environ.get("AZURE_TEXT_ANALYTICS_ENDPOINT")})
@TextAnalyticsClientPreparer()
async def test_cancellation(self, client):
single_doc = "hello world"
docs = [{"id": str(idx), "text": val} for (idx, val) in enumerate(list(itertools.repeat(single_doc, 10)))]

async with client:
poller = await client.begin_analyze_healthcare_entities(docs, polling_interval=self._interval())

try:
cancellation_poller = await poller.cancel()
cancellation_poller.wait()
Expand Down Expand Up @@ -768,7 +768,7 @@ async def test_explicit_set_string_index_type(self, client):
await poller.result()

@GlobalTextAnalyticsAccountPreparer()
@TextAnalyticsClientPreparer(client_kwargs={"text_analytics_account_key": os.environ.get("AZURE_TEXT_ANALYTICS_KEY"), "text_analytics_account": os.environ.get("AZURE_TEXT_ANALYTICS_ENDPOINT")})
@TextAnalyticsClientPreparer()
async def test_bidirectional_relation_type(self, client):
response = await (await client.begin_analyze_healthcare_entities(
documents=["The patient was diagnosed with Parkinsons Disease (PD)"]
Expand All @@ -789,4 +789,4 @@ async def test_bidirectional_relation_type(self, client):
self.assertEqual(related_entity2, entity1)
self.assertEqual(relation_type2, "Abbreviation")