2525import quickstart_exportassets
2626
2727PROJECT = os .environ ["GOOGLE_CLOUD_PROJECT" ]
28- BUCKET = "assets-{}" . format ( uuid .uuid4 ().hex )
29- DATASET = "assets_{}" . format ( int (uuid .uuid4 ()))
28+ BUCKET = f "assets-{ uuid .uuid4 ().hex } "
29+ DATASET = f "assets_{ int (uuid .uuid4 ())} "
3030
3131
3232@pytest .fixture (scope = "module" )
@@ -48,13 +48,13 @@ def asset_bucket(storage_client):
4848 try :
4949 bucket .delete (force = True )
5050 except Exception as e :
51- print ("Failed to delete bucket{}" . format ( BUCKET ) )
51+ print (f "Failed to delete bucket{ BUCKET } " )
5252 raise e
5353
5454
5555@pytest .fixture (scope = 'module' )
5656def dataset (bigquery_client ):
57- dataset_id = "{ }.{}" . format ( PROJECT , DATASET )
57+ dataset_id = f" { PROJECT } .{ DATASET } "
5858 dataset = bigquery .Dataset (dataset_id )
5959 dataset .location = "US"
6060 dataset = bigquery_client .create_dataset (dataset )
@@ -67,7 +67,7 @@ def dataset(bigquery_client):
6767
6868def test_export_assets (asset_bucket , dataset , capsys ):
6969 content_type = asset_v1 .ContentType .IAM_POLICY
70- dump_file_path = "gs://{}/assets-dump.txt" . format ( asset_bucket )
70+ dump_file_path = f "gs://{ asset_bucket } /assets-dump.txt"
7171 quickstart_exportassets .export_assets (
7272 PROJECT ,
7373 dump_file_path ,
@@ -77,7 +77,7 @@ def test_export_assets(asset_bucket, dataset, capsys):
7777 assert dump_file_path in out
7878
7979 content_type = asset_v1 .ContentType .RESOURCE
80- dataset_id = "projects/{}/datasets/{}" . format ( PROJECT , dataset )
80+ dataset_id = f "projects/{ PROJECT } /datasets/{ dataset } "
8181 quickstart_exportassets .export_assets_bigquery (
8282 PROJECT , dataset_id , "assettable" , content_type )
8383 out , _ = capsys .readouterr ()
0 commit comments