Skip to content

Commit 62028bc

Browse files
fix: adding more test case for table constraints property
1 parent 2ab89c3 commit 62028bc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/unit/test_table.py

+13
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,19 @@ def test_table_constraints_property_setter_only_foriegn_keys(self):
10001000
]
10011001
}
10021002

1003+
def test_table_constraints_property_setter_no_constraints(self):
1004+
from google.cloud.bigquery.table import TableConstraints
1005+
1006+
dataset = DatasetReference(self.PROJECT, self.DS_ID)
1007+
table_ref = dataset.table(self.TABLE_NAME)
1008+
table = self._make_one(table_ref)
1009+
1010+
1011+
table_constraints = TableConstraints(primary_key=None, foreign_keys=None)
1012+
table.table_constraints = table_constraints
1013+
1014+
assert table._properties["tableConstraints"] == {}
1015+
10031016
def test_description_setter_bad_value(self):
10041017
dataset = DatasetReference(self.PROJECT, self.DS_ID)
10051018
table_ref = dataset.table(self.TABLE_NAME)

0 commit comments

Comments
 (0)