Skip to content

Commit 7af3815

Browse files
committed
address review feedback
1 parent 85e11f7 commit 7af3815

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

packages/gapic-generator/gapic/templates/tests/unit/gapic/%name_%version/%sub/test_%service.py.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010
{% if api.all_method_settings.values()|map(attribute="auto_populated_fields", default=[])|list %}
1111
import re
12-
_UUID4_RE = re.compile(r"{{ uuid4_re }}")
1312
{% endif %}
1413
from unittest import mock
1514
from unittest.mock import AsyncMock
@@ -107,6 +106,9 @@ CRED_INFO_JSON = {
107106
"principal": "service-account@example.com",
108107
}
109108
CRED_INFO_STRING = json.dumps(CRED_INFO_JSON)
109+
{% if api.all_method_settings.values()|map(attribute="auto_populated_fields", default=[])|list %}
110+
_UUID4_RE = re.compile(r"{{ uuid4_re }}")
111+
{% endif %}
110112

111113

112114
async def mock_async_gen(data, chunk_size=1):

packages/gapic-generator/tests/integration/goldens/storagebatchoperations/tests/unit/gapic/storagebatchoperations_v1/test_storage_batch_operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
import os
1717
import re
18-
_UUID4_RE = re.compile(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}")
1918
from unittest import mock
2019
from unittest.mock import AsyncMock
2120

@@ -75,6 +74,7 @@
7574
"principal": "service-account@example.com",
7675
}
7776
CRED_INFO_STRING = json.dumps(CRED_INFO_JSON)
77+
_UUID4_RE = re.compile(r"[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}")
7878

7979

8080
async def mock_async_gen(data, chunk_size=1):

0 commit comments

Comments
 (0)