mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-05-18 06:22:29 +00:00
chore(types): change optional parameter type from NotGiven to Omit
This commit is contained in:
parent
9751764207
commit
215857f1ee
20 changed files with 272 additions and 256 deletions
|
|
@ -8,7 +8,7 @@ from typing_extensions import Required, Annotated, TypedDict
|
|||
|
||||
import pytest
|
||||
|
||||
from opencode_ai._types import NOT_GIVEN, Base64FileInput
|
||||
from opencode_ai._types import Base64FileInput, omit, not_given
|
||||
from opencode_ai._utils import (
|
||||
PropertyInfo,
|
||||
transform as _transform,
|
||||
|
|
@ -450,4 +450,11 @@ async def test_transform_skipping(use_async: bool) -> None:
|
|||
@pytest.mark.asyncio
|
||||
async def test_strips_notgiven(use_async: bool) -> None:
|
||||
assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
|
||||
assert await transform({"foo_bar": NOT_GIVEN}, Foo1, use_async) == {}
|
||||
assert await transform({"foo_bar": not_given}, Foo1, use_async) == {}
|
||||
|
||||
|
||||
@parametrize
|
||||
@pytest.mark.asyncio
|
||||
async def test_strips_omit(use_async: bool) -> None:
|
||||
assert await transform({"foo_bar": "bar"}, Foo1, use_async) == {"fooBar": "bar"}
|
||||
assert await transform({"foo_bar": omit}, Foo1, use_async) == {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue