Skip to content
Merged
Changes from 1 commit
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
11 changes: 8 additions & 3 deletions tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ def test_use_get_task_push_notification_params_for_request() -> None:
)


def test_camelCase() -> None:
def test_camelCase(recwarn) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In line with the PEP 8 style guide, Python function names should use snake_case. Please rename test_camelCase to test_camel_case for consistency and to adhere to this widely-accepted convention.

Suggested change
def test_camelCase(recwarn) -> None:
def test_camel_case(recwarn) -> None:

skill = AgentSkill(
id='hello_world',
name='Returns hello world',
Expand All @@ -1551,16 +1551,21 @@ def test_camelCase() -> None:
supportsAuthenticatedExtendedCard=True,
)

# Test accessing a standard property like 'version' should not produce a deprecation warning
version = agent_card.version
assert version == '1.0.0'
assert (
not recwarn.list # Assert that no warnings were emitted during the access
)

# Test setting an attribute via camelCase alias
# We expect a DeprecationWarning with a specific message
with pytest.warns(
DeprecationWarning,
match="Setting field 'supportsAuthenticatedExtendedCard'",
):
agent_card.supportsAuthenticatedExtendedCard = False

# Test getting an attribute via camelCase alias
# We expect another DeprecationWarning with a specific message
with pytest.warns(
DeprecationWarning, match="Accessing field 'defaultInputModes'"
):
Expand Down
Loading