@@ -1767,3 +1767,70 @@ def test__hash__with_minimal_inputs(self):
17671767 description = None ,
17681768 )
17691769 assert hash (cond1 ) is not None
1770+
1771+ def test_access_entry_view_equality (self ):
1772+ from google .cloud import bigquery
1773+
1774+ entry1 = bigquery .dataset .AccessEntry (
1775+ entity_type = "view" ,
1776+ entity_id = {
1777+ "projectId" : "my_project" ,
1778+ "datasetId" : "my_dataset" ,
1779+ "tableId" : "my_table" ,
1780+ },
1781+ )
1782+ entry2 = bigquery .dataset .AccessEntry .from_api_repr (
1783+ {
1784+ "view" : {
1785+ "projectId" : "my_project" ,
1786+ "datasetId" : "my_dataset" ,
1787+ "tableId" : "my_table" ,
1788+ }
1789+ }
1790+ )
1791+
1792+ entry3 = bigquery .dataset .AccessEntry (
1793+ entity_type = "routine" ,
1794+ entity_id = {
1795+ "projectId" : "my_project" ,
1796+ "datasetId" : "my_dataset" ,
1797+ "routineId" : "my_routine" ,
1798+ },
1799+ )
1800+
1801+ entry4 = bigquery .dataset .AccessEntry .from_api_repr (
1802+ {
1803+ "routine" : {
1804+ "projectId" : "my_project" ,
1805+ "datasetId" : "my_dataset" ,
1806+ "routineId" : "my_routine" ,
1807+ }
1808+ }
1809+ )
1810+
1811+ entry5 = bigquery .dataset .AccessEntry (
1812+ entity_type = "dataset" ,
1813+ entity_id = {
1814+ "dataset" : {
1815+ "projectId" : "my_project" ,
1816+ "datasetId" : "my_dataset" ,
1817+ },
1818+ "target_types" : "VIEWS" ,
1819+ },
1820+ )
1821+
1822+ entry6 = bigquery .dataset .AccessEntry .from_api_repr (
1823+ {
1824+ "dataset" : {
1825+ "dataset" : {
1826+ "projectId" : "my_project" ,
1827+ "datasetId" : "my_dataset" ,
1828+ },
1829+ "target_types" : "VIEWS" ,
1830+ }
1831+ }
1832+ )
1833+
1834+ assert entry1 == entry2
1835+ assert entry3 == entry4
1836+ assert entry5 == entry6
0 commit comments