mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-07-07 14:45:00 +00:00
Merge 0337b1022d
into 343ec4812c
This commit is contained in:
commit
01c0f6beb5
2 changed files with 16 additions and 1 deletions
|
@ -1,10 +1,14 @@
|
|||
"""Type definitions for Claude SDK."""
|
||||
|
||||
import sys
|
||||
from dataclasses import dataclass, field
|
||||
from pathlib import Path
|
||||
from typing import Any, Literal, TypedDict
|
||||
|
||||
from typing_extensions import NotRequired # For Python < 3.11 compatibility
|
||||
if sys.version_info >= (3, 11):
|
||||
from typing import NotRequired
|
||||
else:
|
||||
from typing_extensions import NotRequired
|
||||
|
||||
# Permission modes
|
||||
PermissionMode = Literal["default", "acceptEdits", "bypassPermissions"]
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
"""Tests for Claude SDK type definitions."""
|
||||
|
||||
import sys
|
||||
import importlib
|
||||
import pytest
|
||||
from claude_code_sdk import (
|
||||
AssistantMessage,
|
||||
ClaudeCodeOptions,
|
||||
|
@ -56,6 +59,14 @@ class TestMessageTypes:
|
|||
assert msg.total_cost_usd == 0.01
|
||||
assert msg.session_id == "session-123"
|
||||
|
||||
def test_import_types_module(self):
|
||||
"""
|
||||
Smoke test to ensure claude_code_sdk.types imports without errors
|
||||
and defines NotRequired.
|
||||
"""
|
||||
module = importlib.reload(importlib.import_module("claude_code_sdk.types"))
|
||||
assert hasattr(module, "NotRequired"), "claude_code_sdk.types should define NotRequired"
|
||||
|
||||
|
||||
class TestOptions:
|
||||
"""Test Options configuration."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue