add a test for access_entries · googleapis/python-bigquery@0cfa704 · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Commit 0cfa704

Browse files
committed
add a test for access_entries
1 parent d5b1455 commit 0cfa704

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

tests/unit/test_dataset.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,34 @@ def test_ctor_explicit(self):
11131113
self.assertIsNone(dataset.location)
11141114
self.assertEqual(dataset.is_case_insensitive, False)
11151115

1116+
def test_access_entries_getter_from_api_repr(self):
1117+
"""Check that `in` works correctly when Dataset is made via from_api_repr()."""
1118+
from google.cloud.bigquery.dataset import AccessEntry
1119+
1120+
dataset = self._get_target_class().from_api_repr(
1121+
{
1122+
"datasetReference": {"projectId": "my-proj", "datasetId": "my_dset"},
1123+
"access": [
1124+
{
1125+
"role": "OWNER",
1126+
"userByEmail": "uilma@example.com",
1127+
},
1128+
{
1129+
"role": "READER",
1130+
"groupByEmail": "rhubbles@example.com",
1131+
},
1132+
],
1133+
}
1134+
)
1135+
assert (
1136+
AccessEntry("OWNER", "userByEmail", "uilma@example.com")
1137+
in dataset.access_entries
1138+
)
1139+
assert (
1140+
AccessEntry("READER", "groupByEmail", "rhubbles@example.com")
1141+
in dataset.access_entries
1142+
)
1143+
11161144
def test_access_entries_setter_non_list(self):
11171145
dataset = self._make_one(self.DS_REF)
11181146
with self.assertRaises(TypeError):

0 commit comments

Comments
 (0)

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.