Skip to content

Commit 561a97b

Browse files
committed
likely gonna delete this branch cause TestTableSchema may not be necessary
1 parent b67dda2 commit 561a97b

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

tests/unit/test_schema.py

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
from google.cloud.bigquery.standard_sql import StandardSqlStructType
1717
from google.cloud.bigquery.schema import (
1818
PolicyTagList,
19-
# ForeignTypeInfo,
19+
ForeignTypeInfo,
2020
StorageDescriptor,
2121
SerDeInfo,
22+
TableSchema,
2223
)
2324

2425
import unittest
@@ -1121,8 +1122,6 @@ class TestForeignTypeInfo:
11211122

11221123
@staticmethod
11231124
def _get_target_class():
1124-
from google.cloud.bigquery.schema import ForeignTypeInfo
1125-
11261125
return ForeignTypeInfo
11271126

11281127
def _make_one(self, *args, **kw):
@@ -1316,3 +1315,40 @@ def test_to_api_repr(self):
13161315
assert serde_info.to_api_repr() == expected_repr
13171316

13181317
# 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

Comments
 (0)