Skip to content

Commit ddae089

Browse files
committed
Add checks for deprecationwarning in tests
1 parent 4f5674b commit ddae089

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

tests/test_types.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,8 +1551,22 @@ def test_camelCase() -> None:
15511551
supportsAuthenticatedExtendedCard=True,
15521552
)
15531553

1554-
agent_card.supportsAuthenticatedExtendedCard = False
1555-
1556-
default_input_modes = agent_card.defaultInputModes
1557-
assert agent_card
1554+
# Test setting an attribute via camelCase alias
1555+
# We expect a DeprecationWarning with a specific message
1556+
with pytest.warns(
1557+
DeprecationWarning,
1558+
match="Setting field 'supportsAuthenticatedExtendedCard'",
1559+
):
1560+
agent_card.supportsAuthenticatedExtendedCard = False
1561+
1562+
# Test getting an attribute via camelCase alias
1563+
# We expect another DeprecationWarning with a specific message
1564+
with pytest.warns(
1565+
DeprecationWarning, match="Accessing field 'defaultInputModes'"
1566+
):
1567+
default_input_modes = agent_card.defaultInputModes
1568+
1569+
# Assert the functionality still works as expected
1570+
assert agent_card.supports_authenticated_extended_card is False
15581571
assert default_input_modes == ['text']
1572+
assert agent_card.default_input_modes == ['text']

0 commit comments

Comments
 (0)