|
16 | 16 | from google.cloud.bigquery.standard_sql import StandardSqlStructType |
17 | 17 | from google.cloud.bigquery.schema import ( |
18 | 18 | PolicyTagList, |
19 | | - # ForeignTypeInfo, |
| 19 | + ForeignTypeInfo, |
20 | 20 | StorageDescriptor, |
21 | 21 | SerDeInfo, |
| 22 | + TableSchema, |
22 | 23 | ) |
23 | 24 |
|
24 | 25 | import unittest |
@@ -1121,8 +1122,6 @@ class TestForeignTypeInfo: |
1121 | 1122 |
|
1122 | 1123 | @staticmethod |
1123 | 1124 | def _get_target_class(): |
1124 | | - from google.cloud.bigquery.schema import ForeignTypeInfo |
1125 | | - |
1126 | 1125 | return ForeignTypeInfo |
1127 | 1126 |
|
1128 | 1127 | def _make_one(self, *args, **kw): |
@@ -1316,3 +1315,40 @@ def test_to_api_repr(self): |
1316 | 1315 | assert serde_info.to_api_repr() == expected_repr |
1317 | 1316 |
|
1318 | 1317 | # TODO: needs a from_api_repr() test. |
| 1318 | + |
| 1319 | +@pytest.fixture |
| 1320 | +def _make_foreign_type_info(): |
| 1321 | + return ForeignTypeInfo( |
| 1322 | + type_system="TODO_fake_type_system", |
| 1323 | + ) |
| 1324 | + |
| 1325 | + |
| 1326 | +class TestTableSchema: |
| 1327 | + @staticmethod |
| 1328 | + def _get_target_class(): |
| 1329 | + return TableSchema |
| 1330 | + |
| 1331 | + def _make_one(self, *args, **kwargs): |
| 1332 | + return self._get_target_class()(*args, **kwargs) |
| 1333 | + |
| 1334 | + def test_ctor_valid_input(self, _make_foreign_type_info): |
| 1335 | + table_schema = self._make_one( |
| 1336 | + fields="TODO needs a fields object", |
| 1337 | + foreign_type_info=_make_foreign_type_info.to_api_repr(), |
| 1338 | + ) |
| 1339 | + # Test default constructors |
| 1340 | + # Create expected TableSchema object |
| 1341 | + # * use target_class |
| 1342 | + # * use make_one |
| 1343 | + # Create result TableSchema object |
| 1344 | + # compare the two |
| 1345 | + assert False |
| 1346 | + |
| 1347 | + def test_ctor_invalid_input(self): |
| 1348 | + assert False |
| 1349 | + |
| 1350 | + def test_to_api_repr(self): |
| 1351 | + assert False |
| 1352 | + |
| 1353 | + def test_from_api_repr(self): |
| 1354 | + assert False |
0 commit comments