Skip to content

Commit 9338116

Browse files
committed
Updates test
1 parent e91fb0a commit 9338116

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

google/cloud/bigquery/external_config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,7 +1168,9 @@ def to_api_repr(self) -> dict:
11681168
Dict[str, Any]:
11691169
A dictionary in the format used by the BigQuery API.
11701170
"""
1171+
11711172
config = copy.deepcopy(self._properties)
1173+
# print("CONFIG: ", config, dir(config))
11721174
return config
11731175

11741176
@classmethod
@@ -1186,3 +1188,6 @@ def from_api_repr(cls, resource: dict) -> ExternalCatalogTableOptions:
11861188
config = cls()
11871189
config._properties = copy.deepcopy(resource)
11881190
return config
1191+
1192+
def __eq__(self, value):
1193+
return self.to_api_repr() == value.to_api_repr()

tests/unit/test_table.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5888,14 +5888,15 @@ def test_external_catalog_table_options_getter(
58885888
# Add an ExternalCatalogTableOptions object to the table.
58895889
table._properties[
58905890
"externalCatalogTableOptions"
5891-
] = external_catalog_table_options
5891+
] = external_catalog_table_options.to_api_repr()
58925892

58935893
# Extract the ecto object.
58945894
result = table.external_catalog_table_options
58955895

58965896
# Confirm that external catalog table options are an
58975897
# ExternalCatalogTableOptions object
58985898
assert isinstance(result, ExternalCatalogTableOptions)
5899+
assert isinstance(expected, ExternalCatalogTableOptions)
58995900
assert result == expected
59005901

59015902
def test_external_catalog_table_options_setter(

0 commit comments

Comments
 (0)