@@ -1767,26 +1767,65 @@ def test__hash__with_minimal_inputs(self):
17671767 description = None ,
17681768 )
17691769 assert hash (cond1 ) is not None
1770-
1770+
17711771 def test_access_entry_view_equality (self ):
1772-
1772+
17731773 from google .cloud import bigquery
1774-
1774+
17751775 entry1 = bigquery .dataset .AccessEntry (
17761776 entity_type = "view" ,
17771777 entity_id = {
1778- "projectId" : "my_project" ,
1779- "datasetId" : "my_dataset" ,
1780- "tableId" : "my_table" ,
1778+ "projectId" :"my_project" ,
1779+ "datasetId" :"my_dataset" ,
1780+ "tableId" :"my_table" ,
17811781 },
17821782 )
17831783 entry2 = bigquery .dataset .AccessEntry .from_api_repr ({
1784- "view" : {
1785- "projectId" : "my_project" ,
1786- "datasetId" : "my_dataset" ,
1787- "tableId" : "my_table" ,
1784+ "view" :{
1785+ "projectId" :"my_project" ,
1786+ "datasetId" :"my_dataset" ,
1787+ "tableId" :"my_table" ,
17881788 }
17891789 })
17901790
1791- assert entry1 == entry2
1791+ entry3 = bigquery .dataset .AccessEntry (
1792+ entity_type = "routine" ,
1793+ entity_id = {
1794+ "projectId" :"my_project" ,
1795+ "datasetId" :"my_dataset" ,
1796+ "routineId" :"my_routine" ,
1797+ },
1798+ )
17921799
1800+ entry4 = bigquery .dataset .AccessEntry .from_api_repr ({
1801+ "routine" :{
1802+ "projectId" :"my_project" ,
1803+ "datasetId" :"my_dataset" ,
1804+ "routineId" :"my_routine" ,
1805+ }
1806+ })
1807+
1808+ entry5 = bigquery .dataset .AccessEntry (
1809+ entity_type = "dataset" ,
1810+ entity_id = {
1811+ "dataset" : {
1812+ "projectId" :"my_project" ,
1813+ "datasetId" :"my_dataset" ,
1814+ },
1815+ "target_types" :"VIEWS" ,
1816+ },
1817+ )
1818+
1819+ entry6 = bigquery .dataset .AccessEntry .from_api_repr ({
1820+ "dataset" :{
1821+ "dataset" :{
1822+ "projectId" :"my_project" ,
1823+ "datasetId" :"my_dataset" ,
1824+ },
1825+ "target_types" :"VIEWS" ,
1826+ }
1827+ })
1828+
1829+ assert entry1 == entry2
1830+ assert entry3 == entry4
1831+ assert entry5 == entry6
0 commit comments