diff --git a/bigquery/tests/unit/test_schema.py b/bigquery/tests/unit/test_schema.py index a5d5ecacd619..1613b4feb465 100644 --- a/bigquery/tests/unit/test_schema.py +++ b/bigquery/tests/unit/test_schema.py @@ -102,6 +102,16 @@ def test_from_api_repr(self): self.assertEqual(field.fields[0].field_type, 'INTEGER') self.assertEqual(field.fields[0].mode, 'NULLABLE') + def test_from_api_repr_defaults(self): + field = self._get_target_class().from_api_repr({ + 'name': 'foo', + 'type': 'record', + }) + self.assertEqual(field.name, 'foo') + self.assertEqual(field.field_type, 'RECORD') + self.assertEqual(field.mode, 'NULLABLE') + self.assertEqual(len(field.fields), 0) + def test_name_property(self): name = 'lemon-ness' schema_field = self._make_one(name, 'INTEGER')