feat: 增强日历功能并集成 AgentScope 代理服务
This commit is contained in:
@@ -86,3 +86,30 @@ def test_metadata_attachment_reminder() -> None:
|
||||
)
|
||||
assert attachment.type == AttachmentType.REMINDER
|
||||
assert attachment.content == "Don't forget!"
|
||||
|
||||
|
||||
def test_metadata_rejects_invalid_color() -> None:
|
||||
with pytest.raises(ValidationError):
|
||||
ScheduleItemMetadata(color="blue")
|
||||
|
||||
|
||||
def test_metadata_rejects_invalid_version() -> None:
|
||||
with pytest.raises(ValidationError):
|
||||
ScheduleItemMetadata(version=2)
|
||||
|
||||
|
||||
def test_metadata_rejects_unknown_field() -> None:
|
||||
with pytest.raises(ValidationError):
|
||||
ScheduleItemMetadata.model_validate({"color": "#FF6B6B", "unknown": True})
|
||||
|
||||
|
||||
def test_metadata_attachment_rejects_unknown_field() -> None:
|
||||
with pytest.raises(ValidationError):
|
||||
ScheduleItemMetadataAttachment.model_validate(
|
||||
{
|
||||
"name": "memo",
|
||||
"type": "document",
|
||||
"url": "https://example.com",
|
||||
"unexpected": "x",
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user