@@ -55,13 +55,15 @@ def test_basic(url_with_everything):
5555 assert credentials_path == '/some/path/to.json'
5656 assert isinstance (job_config , QueryJobConfig )
5757
58+
5859@pytest .mark .parametrize ('param, value' , [
5960 ('clustering_fields' , ['a' , 'b' , 'c' ]),
6061 ('create_disposition' , 'CREATE_IF_NEEDED' ),
6162 ('destination' , TableReference (DatasetReference ('different-project' , 'different-dataset' ), 'table' )),
62- ('destination_encryption_configuration' , lambda enc : enc .kms_key_name == EncryptionConfiguration ('some-configuration' ).kms_key_name ),
63+ ('destination_encryption_configuration' ,
64+ lambda enc : enc .kms_key_name == EncryptionConfiguration ('some-configuration' ).kms_key_name ),
6365 ('dry_run' , True ),
64- ('labels' , { 'a' : 'b' , 'c' : 'd' }),
66+ ('labels' , {'a' : 'b' , 'c' : 'd' }),
6567 ('maximum_bytes_billed' , 1000 ),
6668 ('priority' , 'INTERACTIVE' ),
6769 ('schema_update_options' , ['ALLOW_FIELD_ADDITION' , 'ALLOW_FIELD_RELAXATION' ]),
@@ -77,11 +79,6 @@ def test_all_values(url_with_everything, param, value):
7779 else :
7880 assert config_value == value
7981
80- # def test_malformed():
81- # location, dataset_id, arraysize, credentials_path, job_config = parse_url(make_url('bigquery:///?credentials_path=a'))
82-
83- # print(credentials_path)
84- # assert False
8582
8683@pytest .mark .parametrize ("param, value" , [
8784 ('arraysize' , 'not-int' ),
@@ -100,13 +97,15 @@ def test_bad_values(param, value):
10097 with pytest .raises (ValueError ):
10198 parse_url (url )
10299
100+
103101def test_empty_url ():
104102 for value in parse_url (make_url ('bigquery://' )):
105103 assert value is None
106104
107105 for value in parse_url (make_url ('bigquery:///' )):
108106 assert value is None
109107
108+
110109def test_empty_with_non_config ():
111110 url = parse_url (make_url ('bigquery:///?location=some-location&arraysize=1000&credentials_path=/some/path/to.json' ))
112111 project_id , location , dataset_id , arraysize , credentials_path , job_config = url
@@ -118,6 +117,7 @@ def test_empty_with_non_config():
118117 assert credentials_path == '/some/path/to.json'
119118 assert job_config is None
120119
120+
121121def test_only_dataset ():
122122 url = parse_url (make_url ('bigquery:///some-dataset' ))
123123 project_id , location , dataset_id , arraysize , credentials_path , job_config = url
@@ -131,6 +131,7 @@ def test_only_dataset():
131131 # we can't actually test that the dataset is on the job_config,
132132 # since we take care of that afterwards, when we have a client to fill in the project
133133
134+
134135@pytest .mark .parametrize ('disallowed_arg' , [
135136 'use_legacy_sql' ,
136137 'allow_large_results' ,
@@ -145,6 +146,7 @@ def test_disallowed(disallowed_arg):
145146 with pytest .raises (ValueError ):
146147 parse_url (url )
147148
149+
148150@pytest .mark .parametrize ('not_implemented_arg' , [
149151 'query_parameters' ,
150152 'table_definitions' ,
0 commit comments