Skip to content

Commit 253ac1f

Browse files
committed
undelete test_to_api_repr_with_subfield
1 parent 2e1daa8 commit 253ac1f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/unit/test_schema.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,20 @@ def test_to_api_repr_omits_unset_properties(self):
177177
self.assertNotIn("description", resource)
178178
self.assertNotIn("policyTags", resource)
179179

180+
def test_to_api_repr_with_subfield(self):
181+
for record_type in ("RECORD", "STRUCT"):
182+
subfield = self._make_one("bar", "INTEGER", "NULLABLE")
183+
field = self._make_one("foo", record_type, "REQUIRED", fields=(subfield,))
184+
self.assertEqual(
185+
field.to_api_repr(),
186+
{
187+
"fields": [{"mode": "NULLABLE", "name": "bar", "type": "INTEGER"}],
188+
"mode": "REQUIRED",
189+
"name": "foo",
190+
"type": record_type,
191+
},
192+
)
193+
180194
def test_to_api_repr_w_timestamp_precision(self):
181195
field = self._make_one(
182196
"foo",

0 commit comments

Comments
 (0)