Skip to content

Commit 9c67431

Browse files
committed
fix repr test
1 parent cab6b1f commit 9c67431

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

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

+17-4
Original file line numberDiff line numberDiff line change
@@ -275,20 +275,33 @@ def data_source():
275275
return model, model_repr
276276

277277
@pytest.fixture
278-
def healthcare_entity(data_source):
278+
def healthcare_entity_assertion():
279+
model = _models.HealthcareEntityAssertion(
280+
conditionality="conditionality",
281+
certainty="certainty",
282+
association="association",
283+
)
284+
model_repr = "HealthcareEntityAssertion(conditionality=conditionality, certainty=certainty, association=association)"
285+
286+
assert repr(model) == model_repr
287+
return model, model_repr
288+
289+
@pytest.fixture
290+
def healthcare_entity(data_source, healthcare_entity_assertion):
279291
model = _models.HealthcareEntity(
280292
text="Bonjour",
281293
normalized_text="Bonjour",
282294
category="MyCategory",
283295
subcategory="MySubcategory",
296+
assertion=healthcare_entity_assertion[0],
284297
length=7,
285298
offset=12,
286299
confidence_score=0.95,
287300
data_sources=[data_source[0]],
288301
)
289302
model_repr = (
290-
"HealthcareEntity(text=Bonjour, normalized_text=Bonjour, category=MyCategory, subcategory=MySubcategory, length=7, offset=12, " +
291-
"confidence_score=0.95, data_sources=[{}])".format(data_source[1])
303+
"HealthcareEntity(text=Bonjour, normalized_text=Bonjour, category=MyCategory, subcategory=MySubcategory, assertion={}, length=7, offset=12, "\
304+
"confidence_score=0.95, data_sources=[{}])".format(healthcare_entity_assertion[1], data_source[1])
292305
)
293306

294307
assert repr(model) == model_repr
@@ -494,4 +507,4 @@ def test_analyze_healthcare_entities_result_item(
494507
)
495508
)
496509

497-
assert repr(model) == model_repr
510+
assert repr(model) == model_repr[:1024]

0 commit comments

Comments
 (0)