Skip to content

Commit 95d4039

Browse files
bokelleyclaude
andcommitted
Fix test: PropertyId and PropertyTag are now separate types
With the upstream schema refactoring, PropertyTag is no longer a subclass of PropertyId. Both are now separate RootModel[str] types defined in their own schema files (property-id.json and property-tag.json). Updated test to verify: - Both are RootModel subclasses - Both work correctly with their respective patterns - They are separate, independent types (not in inheritance relationship) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7b37ed8 commit 95d4039

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tests/test_type_aliases.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,14 @@ def test_publisher_properties_aliases_in_exports():
430430

431431

432432
def test_property_id_and_tag_are_root_models():
433-
"""Test that PropertyId and PropertyTag are properly constrained string types."""
433+
"""Test that PropertyId and PropertyTag are properly constrained string types.
434+
435+
As of AdCP v1.0.0, PropertyId and PropertyTag are separate RootModel types
436+
defined in their own schema files, not in an inheritance relationship.
437+
Both use the same pattern constraint (^[a-z0-9_]+$) but are semantically distinct.
438+
"""
434439
from adcp import PropertyId, PropertyTag
440+
from pydantic import RootModel
435441

436442
# Create valid PropertyId and PropertyTag
437443
prop_id = PropertyId("my_property_id")
@@ -441,8 +447,14 @@ def test_property_id_and_tag_are_root_models():
441447
assert prop_id.root == "my_property_id"
442448
assert prop_tag.root == "premium"
443449

444-
# PropertyTag should be a subclass of PropertyId
445-
assert issubclass(PropertyTag, PropertyId)
450+
# Both should be RootModel subclasses (but not related to each other)
451+
assert issubclass(PropertyId, RootModel)
452+
assert issubclass(PropertyTag, RootModel)
453+
454+
# They are separate types, not in an inheritance relationship
455+
assert PropertyId is not PropertyTag
456+
assert not issubclass(PropertyTag, PropertyId)
457+
assert not issubclass(PropertyId, PropertyTag)
446458

447459

448460
def test_deployment_aliases_imports():

0 commit comments

Comments
 (0)