Skip to content

Commit 91289e2

Browse files
fix(core): preserve legitimate falsy values in _clean_empty (lint)
1 parent 6863fcb commit 91289e2

1 file changed

Lines changed: 14 additions & 12 deletions

File tree

tests/utils/test_helpers.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
import pytest
77

88
from a2a.types import (
9-
Artifact,
9+
AgentCapabilities,
1010
AgentCard,
1111
AgentCardSignature,
12-
AgentCapabilities,
1312
AgentSkill,
13+
Artifact,
1414
Message,
1515
MessageSendParams,
1616
Part,
@@ -22,13 +22,13 @@
2222
)
2323
from a2a.utils.errors import ServerError
2424
from a2a.utils.helpers import (
25+
_clean_empty,
2526
append_artifact_to_task,
2627
are_modalities_compatible,
2728
build_text_artifact,
29+
canonicalize_agent_card,
2830
create_task_obj,
2931
validate,
30-
_clean_empty,
31-
canonicalize_agent_card,
3232
)
3333

3434

@@ -385,13 +385,15 @@ def test_canonicalize_agent_card():
385385

386386
def test_canonicalize_agent_card_preserves_false_capability():
387387
"""Regression #692: streaming=False must not be stripped from canonical JSON."""
388-
card = AgentCard(**{
389-
**SAMPLE_AGENT_CARD,
390-
'capabilities': AgentCapabilities(
391-
streaming=False,
392-
push_notifications=True,
393-
),
394-
})
388+
card = AgentCard(
389+
**{
390+
**SAMPLE_AGENT_CARD,
391+
'capabilities': AgentCapabilities(
392+
streaming=False,
393+
push_notifications=True,
394+
),
395+
}
396+
)
395397
result = canonicalize_agent_card(card)
396398
assert '"streaming":false' in result
397399

@@ -473,4 +475,4 @@ def test_clean_empty_does_not_mutate_input():
473475

474476
_clean_empty(original)
475477

476-
assert original == copy
478+
assert original == copy

0 commit comments

Comments
 (0)