Skip to content

Commit 766304e

Browse files
committed
updates to generated test output
1 parent f5190e3 commit 766304e

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

tests/codegen/rpc/generated/test_service/__init__.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@
66
from pydantic import TypeAdapter
77

88
from replit_river.error_schema import RiverError
9+
10+
RiverErrorTypeAdapter = TypeAdapter(RiverError)
911
import replit_river as river
1012

1113

12-
from .rpc_method import Rpc_MethodInput, Rpc_MethodOutput, encode_Rpc_MethodInput
14+
from .rpc_method import (
15+
Rpc_MethodInput,
16+
Rpc_MethodInputTypeAdapter,
17+
Rpc_MethodOutput,
18+
Rpc_MethodOutputTypeAdapter,
19+
encode_Rpc_MethodInput,
20+
)
1321

1422

1523
class Test_ServiceService:
@@ -26,10 +34,10 @@ async def rpc_method(
2634
"rpc_method",
2735
input,
2836
encode_Rpc_MethodInput,
29-
lambda x: TypeAdapter(Rpc_MethodOutput).validate_python(
37+
lambda x: Rpc_MethodOutputTypeAdapter.validate_python(
3038
x # type: ignore[arg-type]
3139
),
32-
lambda x: TypeAdapter(RiverError).validate_python(
40+
lambda x: RiverErrorTypeAdapter.validate_python(
3341
x # type: ignore[arg-type]
3442
),
3543
timeout,

tests/codegen/rpc/generated/test_service/rpc_method.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,11 @@ class Rpc_MethodInput(TypedDict):
3939
data: str
4040

4141

42+
Rpc_MethodInputTypeAdapter = TypeAdapter(Rpc_MethodInput) # type: ignore
43+
44+
4245
class Rpc_MethodOutput(BaseModel):
4346
data: str
47+
48+
49+
Rpc_MethodOutputTypeAdapter = TypeAdapter(Rpc_MethodOutput) # type: ignore

tests/codegen/stream/generated/test_service/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
from pydantic import TypeAdapter
77

88
from replit_river.error_schema import RiverError
9+
10+
RiverErrorTypeAdapter = TypeAdapter(RiverError)
911
import replit_river as river
1012

1113

1214
from .stream_method import (
1315
Stream_MethodInput,
16+
Stream_MethodInputTypeAdapter,
1417
Stream_MethodOutput,
18+
Stream_MethodOutputTypeAdapter,
1519
encode_Stream_MethodInput,
1620
)
1721

@@ -31,10 +35,10 @@ async def stream_method(
3135
inputStream,
3236
None,
3337
encode_Stream_MethodInput,
34-
lambda x: TypeAdapter(Stream_MethodOutput).validate_python(
38+
lambda x: Stream_MethodOutputTypeAdapter.validate_python(
3539
x # type: ignore[arg-type]
3640
),
37-
lambda x: TypeAdapter(RiverError).validate_python(
41+
lambda x: RiverErrorTypeAdapter.validate_python(
3842
x # type: ignore[arg-type]
3943
),
4044
)

tests/codegen/stream/generated/test_service/stream_method.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,11 @@ class Stream_MethodInput(TypedDict):
3939
data: str
4040

4141

42+
Stream_MethodInputTypeAdapter = TypeAdapter(Stream_MethodInput) # type: ignore
43+
44+
4245
class Stream_MethodOutput(BaseModel):
4346
data: str
47+
48+
49+
Stream_MethodOutputTypeAdapter = TypeAdapter(Stream_MethodOutput) # type: ignore

0 commit comments

Comments
 (0)