@@ -19,18 +19,18 @@ class TestUploadBuild(BaseAWSCommandParamsTest):
1919 prefix = 'gamelift upload-build'
2020
2121 def setUp (self ):
22- super (TestUploadBuild , self ).setUp ()
22+ super ().setUp ()
2323 self .files = FileCreator ()
2424
2525 def tearDown (self ):
26- super (TestUploadBuild , self ).tearDown ()
26+ super ().tearDown ()
2727 self .files .remove_all ()
2828
2929 def test_upload_build (self ):
3030 self .files .create_file ('tmpfile' , 'Some contents' )
3131 cmdline = self .prefix
3232 cmdline += ' --name mybuild --build-version myversion'
33- cmdline += ' --build-root %s' % self .files .rootdir
33+ cmdline += f ' --build-root { self .files .rootdir } '
3434
3535 self .parsed_responses = [
3636 {'Build' : {'BuildId' : 'myid' }},
@@ -69,15 +69,15 @@ def test_upload_build(self):
6969
7070 # Check the output of the command.
7171 self .assertIn (
72- 'Successfully uploaded %s to AWS GameLift' % self . files . rootdir ,
72+ f 'Successfully uploaded { self . files . rootdir } to AWS GameLift' ,
7373 stdout )
7474 self .assertIn ('Build ID: myid' , stdout )
7575
7676 def test_upload_build_with_operating_system_param (self ):
7777 self .files .create_file ('tmpfile' , 'Some contents' )
7878 cmdline = self .prefix
7979 cmdline += ' --name mybuild --build-version myversion'
80- cmdline += ' --build-root %s' % self .files .rootdir
80+ cmdline += f ' --build-root { self .files .rootdir } '
8181 cmdline += ' --operating-system WINDOWS_2012'
8282
8383 self .parsed_responses = [
@@ -118,14 +118,14 @@ def test_upload_build_with_operating_system_param(self):
118118
119119 # Check the output of the command.
120120 self .assertIn (
121- 'Successfully uploaded %s to AWS GameLift' % self . files . rootdir ,
121+ f 'Successfully uploaded { self . files . rootdir } to AWS GameLift' ,
122122 stdout )
123123 self .assertIn ('Build ID: myid' , stdout )
124124
125125 def test_upload_build_with_empty_directory (self ):
126126 cmdline = self .prefix
127127 cmdline += ' --name mybuild --build-version myversion'
128- cmdline += ' --build-root %s' % self .files .rootdir
128+ cmdline += f ' --build-root { self .files .rootdir } '
129129
130130 self .parsed_responses = [
131131 {'Build' : {'BuildId' : 'myid' }},
@@ -142,17 +142,16 @@ def test_upload_build_with_empty_directory(self):
142142 stdout , stderr , rc = self .run_cmd (cmdline , expected_rc = 255 )
143143
144144 self .assertIn (
145- 'Fail to upload %s. '
146- 'The build root directory is empty or does not exist.\n '
147- % self .files .rootdir ,
145+ f'Fail to upload { self .files .rootdir } . '
146+ 'The build root directory is empty or does not exist.\n ' ,
148147 stderr )
149148
150149 def test_upload_build_with_nonexistent_directory (self ):
151150 dir_not_exist = os .path .join (self .files .rootdir , 'does_not_exist' )
152151
153152 cmdline = self .prefix
154153 cmdline += ' --name mybuild --build-version myversion'
155- cmdline += ' --build-root %s' % dir_not_exist
154+ cmdline += f ' --build-root { dir_not_exist } '
156155
157156 self .parsed_responses = [
158157 {'Build' : {'BuildId' : 'myid' }},
@@ -169,15 +168,14 @@ def test_upload_build_with_nonexistent_directory(self):
169168 stdout , stderr , rc = self .run_cmd (cmdline , expected_rc = 255 )
170169
171170 self .assertIn (
172- 'Fail to upload %s. '
173- 'The build root directory is empty or does not exist.\n '
174- % dir_not_exist ,
171+ f'Fail to upload { dir_not_exist } . '
172+ 'The build root directory is empty or does not exist.\n ' ,
175173 stderr )
176174
177175 def test_upload_build_with_nonprovided_directory (self ):
178176 cmdline = self .prefix
179177 cmdline += ' --name mybuild --build-version myversion'
180- cmdline += ' --build-root %s' % '""'
178+ cmdline += ' --build-root {}' . format ( '""' )
181179
182180 self .parsed_responses = [
183181 {'Build' : {'BuildId' : 'myid' }},
@@ -194,16 +192,15 @@ def test_upload_build_with_nonprovided_directory(self):
194192 stdout , stderr , rc = self .run_cmd (cmdline , expected_rc = 255 )
195193
196194 self .assertIn (
197- 'Fail to upload %s. '
198- 'The build root directory is empty or does not exist.\n '
199- % '""' ,
195+ 'Fail to upload {}. '
196+ 'The build root directory is empty or does not exist.\n ' .format ('""' ),
200197 stderr )
201198
202199 def test_upload_build_with_server_sdk_version_param (self ):
203200 self .files .create_file ('tmpfile' , 'Some contents' )
204201 cmdline = self .prefix
205202 cmdline += ' --name mybuild --build-version myversion'
206- cmdline += ' --build-root %s' % self .files .rootdir
203+ cmdline += f ' --build-root { self .files .rootdir } '
207204 cmdline += ' --server-sdk-version 4.0.2'
208205
209206 self .parsed_responses = [
@@ -244,7 +241,7 @@ def test_upload_build_with_server_sdk_version_param(self):
244241
245242 # Check the output of the command.
246243 self .assertIn (
247- 'Successfully uploaded %s to AWS GameLift' % self . files . rootdir ,
244+ f 'Successfully uploaded { self . files . rootdir } to AWS GameLift' ,
248245 stdout )
249246 self .assertIn ('Build ID: myid' , stdout )
250247
@@ -258,10 +255,10 @@ def test_upload_build_with_tags_param(self):
258255
259256 cmdline = self .prefix
260257 cmdline += ' --name mybuild --build-version myversion'
261- cmdline += ' --build-root %s' % self .files .rootdir
258+ cmdline += f ' --build-root { self .files .rootdir } '
262259 cmdline += ' --tags'
263260 for tag in expected_tags :
264- cmdline += ' %s=%s' % (tag ['Key' ], tag ['Value' ])
261+ cmdline += ' {}={}' . format (tag ['Key' ], tag ['Value' ])
265262
266263 self .parsed_responses = [
267264 {'Build' : {'BuildId' : 'myid' }},
@@ -301,6 +298,6 @@ def test_upload_build_with_tags_param(self):
301298
302299 # Check the output of the command.
303300 self .assertIn (
304- 'Successfully uploaded %s to AWS GameLift' % self . files . rootdir ,
301+ f 'Successfully uploaded { self . files . rootdir } to AWS GameLift' ,
305302 stdout )
306303 self .assertIn ('Build ID: myid' , stdout )
0 commit comments