Skip to content

Commit

Permalink
construct resource id in testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
kristapratico committed May 20, 2020
1 parent 688c3eb commit 58a2210
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions sdk/formrecognizer/azure-ai-formrecognizer/tests/test_mgmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_mgmt_model_labeled(self, client, container_sas_url):
models_list = client.list_custom_models()
for model in models_list:
self.assertIsNotNone(model.model_id)
self.assertEqual(model.status, "ready")
self.assertIsNotNone(model.status)
self.assertIsNotNone(model.created_on)
self.assertIsNotNone(model.last_modified)

Expand Down Expand Up @@ -114,7 +114,7 @@ def test_mgmt_model_unlabeled(self, client, container_sas_url):
models_list = client.list_custom_models()
for model in models_list:
self.assertIsNotNone(model.model_id)
self.assertEqual(model.status, "ready")
self.assertIsNotNone(model.status)
self.assertIsNotNone(model.created_on)
self.assertIsNotNone(model.last_modified)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def test_mgmt_model_labeled(self, client, container_sas_url):
models_list = client.list_custom_models()
async for model in models_list:
self.assertIsNotNone(model.model_id)
self.assertEqual(model.status, "ready")
self.assertIsNotNone(model.status)
self.assertIsNotNone(model.created_on)
self.assertIsNotNone(model.last_modified)

Expand Down Expand Up @@ -112,7 +112,7 @@ async def test_mgmt_model_unlabeled(self, client, container_sas_url):
models_list = client.list_custom_models()
async for model in models_list:
self.assertIsNotNone(model.model_id)
self.assertEqual(model.status, "ready")
self.assertIsNotNone(model.status)
self.assertIsNotNone(model.created_on)
self.assertIsNotNone(model.last_modified)

Expand Down
4 changes: 3 additions & 1 deletion sdk/formrecognizer/azure-ai-formrecognizer/tests/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,11 @@ def create_resource(self, name, **kwargs):
if self.copy:
if self.is_live:
resource_group = kwargs.get("resource_group")
subscription_id = self.get_settings_value("SUBSCRIPTION_ID")
form_recognizer_name = FormRecognizerTest._FORM_RECOGNIZER_NAME

resource_id = resource_group.id + "/providers/Microsoft.CognitiveServices/accounts/" + form_recognizer_name
resource_id = "/subscriptions/" + subscription_id + "/resourceGroups/" + resource_group.name + \
"/providers/Microsoft.CognitiveServices/accounts/" + form_recognizer_name
resource_location = "westus"
self.test_class_instance.scrubber.register_name_pair(
resource_id,
Expand Down

0 comments on commit 58a2210

Please sign in to comment.