Skip to content

Commit 9d07191

Browse files
committed
fixed veneer unit test
1 parent 08829da commit 9d07191

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

tests/unit/data/_async/test_client.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,20 +1358,13 @@ async def test_call_metadata(self, include_app_profile, fn_name, fn_args, gapic_
13581358
# expect x-goog-request-params tag
13591359
assert metadata[0][0] == "x-goog-request-params"
13601360
routing_str = metadata[0][1]
1361-
assert self._expected_routing_header(table) in routing_str
1361+
assert f"table_name={table.table_name}" in routing_str
13621362
if include_app_profile:
13631363
assert "app_profile_id=profile" in routing_str
13641364
else:
13651365
# empty app_profile_id should send empty string
13661366
assert "app_profile_id=" in routing_str
13671367

1368-
@staticmethod
1369-
def _expected_routing_header(table):
1370-
"""
1371-
the expected routing header for this _ApiSurface type
1372-
"""
1373-
return f"table_name={table.table_name}"
1374-
13751368

13761369
@CrossSync.convert_class(
13771370
"TestAuthorizedView", add_mapping_for_name="TestAuthorizedView"
@@ -1399,13 +1392,6 @@ def _make_one(
13991392
client, instance_id, table_id, view_id, app_profile_id, **kwargs
14001393
)
14011394

1402-
@staticmethod
1403-
def _expected_routing_header(view):
1404-
"""
1405-
the expected routing header for this _ApiSurface type
1406-
"""
1407-
return f"authorized_view_name={view.authorized_view_name}"
1408-
14091395
@CrossSync.pytest
14101396
async def test_ctor(self):
14111397
from google.cloud.bigtable.data._helpers import _WarmedInstanceKey

tests/unit/data/_sync_autogen/test_client.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,17 +1085,12 @@ def test_call_metadata(self, include_app_profile, fn_name, fn_args, gapic_fn):
10851085
assert len(metadata) == 1
10861086
assert metadata[0][0] == "x-goog-request-params"
10871087
routing_str = metadata[0][1]
1088-
assert self._expected_routing_header(table) in routing_str
1088+
assert f"table_name={table.table_name}" in routing_str
10891089
if include_app_profile:
10901090
assert "app_profile_id=profile" in routing_str
10911091
else:
10921092
assert "app_profile_id=" in routing_str
10931093

1094-
@staticmethod
1095-
def _expected_routing_header(table):
1096-
"""the expected routing header for this _ApiSurface type"""
1097-
return f"table_name={table.table_name}"
1098-
10991094

11001095
@CrossSync._Sync_Impl.add_mapping_decorator("TestAuthorizedView")
11011096
class TestAuthorizedView(CrossSync._Sync_Impl.TestTable):
@@ -1120,11 +1115,6 @@ def _make_one(
11201115
client, instance_id, table_id, view_id, app_profile_id, **kwargs
11211116
)
11221117

1123-
@staticmethod
1124-
def _expected_routing_header(view):
1125-
"""the expected routing header for this _ApiSurface type"""
1126-
return f"authorized_view_name={view.authorized_view_name}"
1127-
11281118
def test_ctor(self):
11291119
from google.cloud.bigtable.data._helpers import _WarmedInstanceKey
11301120

0 commit comments

Comments
 (0)