@@ -683,7 +683,9 @@ def test_lookup(request_type, transport: str = "grpc"):
683
683
# Mock the actual call within the gRPC stub, and fake the request.
684
684
with mock .patch .object (type (client .transport .lookup ), "__call__" ) as call :
685
685
# Designate an appropriate return value for the call.
686
- call .return_value = datastore .LookupResponse ()
686
+ call .return_value = datastore .LookupResponse (
687
+ transaction = b"transaction_blob" ,
688
+ )
687
689
response = client .lookup (request )
688
690
689
691
# Establish that the underlying gRPC stub method was called.
@@ -693,6 +695,7 @@ def test_lookup(request_type, transport: str = "grpc"):
693
695
694
696
# Establish that the response is the type that we expect.
695
697
assert isinstance (response , datastore .LookupResponse )
698
+ assert response .transaction == b"transaction_blob"
696
699
697
700
698
701
def test_lookup_empty_call ():
@@ -728,7 +731,9 @@ async def test_lookup_async(
728
731
with mock .patch .object (type (client .transport .lookup ), "__call__" ) as call :
729
732
# Designate an appropriate return value for the call.
730
733
call .return_value = grpc_helpers_async .FakeUnaryUnaryCall (
731
- datastore .LookupResponse ()
734
+ datastore .LookupResponse (
735
+ transaction = b"transaction_blob" ,
736
+ )
732
737
)
733
738
response = await client .lookup (request )
734
739
@@ -739,6 +744,7 @@ async def test_lookup_async(
739
744
740
745
# Establish that the response is the type that we expect.
741
746
assert isinstance (response , datastore .LookupResponse )
747
+ assert response .transaction == b"transaction_blob"
742
748
743
749
744
750
@pytest .mark .asyncio
@@ -941,7 +947,9 @@ def test_run_query(request_type, transport: str = "grpc"):
941
947
# Mock the actual call within the gRPC stub, and fake the request.
942
948
with mock .patch .object (type (client .transport .run_query ), "__call__" ) as call :
943
949
# Designate an appropriate return value for the call.
944
- call .return_value = datastore .RunQueryResponse ()
950
+ call .return_value = datastore .RunQueryResponse (
951
+ transaction = b"transaction_blob" ,
952
+ )
945
953
response = client .run_query (request )
946
954
947
955
# Establish that the underlying gRPC stub method was called.
@@ -951,6 +959,7 @@ def test_run_query(request_type, transport: str = "grpc"):
951
959
952
960
# Establish that the response is the type that we expect.
953
961
assert isinstance (response , datastore .RunQueryResponse )
962
+ assert response .transaction == b"transaction_blob"
954
963
955
964
956
965
def test_run_query_empty_call ():
@@ -986,7 +995,9 @@ async def test_run_query_async(
986
995
with mock .patch .object (type (client .transport .run_query ), "__call__" ) as call :
987
996
# Designate an appropriate return value for the call.
988
997
call .return_value = grpc_helpers_async .FakeUnaryUnaryCall (
989
- datastore .RunQueryResponse ()
998
+ datastore .RunQueryResponse (
999
+ transaction = b"transaction_blob" ,
1000
+ )
990
1001
)
991
1002
response = await client .run_query (request )
992
1003
@@ -997,6 +1008,7 @@ async def test_run_query_async(
997
1008
998
1009
# Establish that the response is the type that we expect.
999
1010
assert isinstance (response , datastore .RunQueryResponse )
1011
+ assert response .transaction == b"transaction_blob"
1000
1012
1001
1013
1002
1014
@pytest .mark .asyncio
@@ -1067,7 +1079,9 @@ def test_run_aggregation_query(request_type, transport: str = "grpc"):
1067
1079
type (client .transport .run_aggregation_query ), "__call__"
1068
1080
) as call :
1069
1081
# Designate an appropriate return value for the call.
1070
- call .return_value = datastore .RunAggregationQueryResponse ()
1082
+ call .return_value = datastore .RunAggregationQueryResponse (
1083
+ transaction = b"transaction_blob" ,
1084
+ )
1071
1085
response = client .run_aggregation_query (request )
1072
1086
1073
1087
# Establish that the underlying gRPC stub method was called.
@@ -1077,6 +1091,7 @@ def test_run_aggregation_query(request_type, transport: str = "grpc"):
1077
1091
1078
1092
# Establish that the response is the type that we expect.
1079
1093
assert isinstance (response , datastore .RunAggregationQueryResponse )
1094
+ assert response .transaction == b"transaction_blob"
1080
1095
1081
1096
1082
1097
def test_run_aggregation_query_empty_call ():
@@ -1116,7 +1131,9 @@ async def test_run_aggregation_query_async(
1116
1131
) as call :
1117
1132
# Designate an appropriate return value for the call.
1118
1133
call .return_value = grpc_helpers_async .FakeUnaryUnaryCall (
1119
- datastore .RunAggregationQueryResponse ()
1134
+ datastore .RunAggregationQueryResponse (
1135
+ transaction = b"transaction_blob" ,
1136
+ )
1120
1137
)
1121
1138
response = await client .run_aggregation_query (request )
1122
1139
@@ -1127,6 +1144,7 @@ async def test_run_aggregation_query_async(
1127
1144
1128
1145
# Establish that the response is the type that we expect.
1129
1146
assert isinstance (response , datastore .RunAggregationQueryResponse )
1147
+ assert response .transaction == b"transaction_blob"
1130
1148
1131
1149
1132
1150
@pytest .mark .asyncio
0 commit comments