File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ # Copyright (c) Microsoft Corporation.
2+ # Licensed under the MIT License.
3+
4+
5+ import ast
6+ import inspect
7+ from typing import get_type_hints
8+
9+ from durabletask .internal .orchestrator_service_pb2_grpc import TaskHubSidecarServiceStub
10+ from durabletask .internal .proto_task_hub_sidecar_service_stub import ProtoTaskHubSidecarServiceStub
11+
12+
13+ def test_proto_task_hub_shim_is_compatible ():
14+ """Test that ProtoTaskHubSidecarServiceStub is compatible with TaskHubSidecarServiceStub."""
15+ protocol_attrs = set (get_type_hints (ProtoTaskHubSidecarServiceStub ).keys ())
16+
17+ # Instantiate TaskHubSidecarServiceStub with a dummy channel to get its attributes
18+ class TestChannel ():
19+ def unary_unary (self , * args , ** kwargs ):
20+ pass
21+
22+ def unary_stream (self , * args , ** kwargs ):
23+ pass
24+ impl_attrs = TaskHubSidecarServiceStub (TestChannel ()).__dict__ .keys ()
25+
26+ # Check missing
27+ assert protocol_attrs == impl_attrs
You can’t perform that action at this time.
0 commit comments