1111# ANY KIND, either express or implied. See the License for the specific
1212# language governing permissions and limitations under the License.
1313import os
14- import random
1514import re
1615import shutil
1716import signal
2423from awscli .testutils import (
2524 BaseS3CLICommand ,
2625 aws ,
26+ random_bucket_name ,
2727 skip_if_windows ,
2828 temporary_file ,
2929 unittest ,
@@ -173,9 +173,7 @@ def test_param_with_file(self):
173173 def test_streaming_output_operation (self ):
174174 d = tempfile .mkdtemp ()
175175 self .addCleanup (shutil .rmtree , d )
176- bucket_name = (
177- 'clistream' + str (int (time .time ())) + str (random .randint (1 , 100 ))
178- )
176+ bucket_name = random_bucket_name ('clistream' )
179177
180178 self .put_object (
181179 bucket = bucket_name , key = 'foobar' , content = 'foobar contents'
@@ -196,9 +194,7 @@ def test_no_sign_request(self):
196194 env_vars ['AWS_ACCESS_KEY_ID' ] = 'foo'
197195 env_vars ['AWS_SECRET_ACCESS_KEY' ] = 'bar'
198196
199- bucket_name = (
200- 'nosign' + str (int (time .time ())) + str (random .randint (1 , 100 ))
201- )
197+ bucket_name = random_bucket_name ('nosign' )
202198 self .put_object (
203199 bucket_name ,
204200 'foo' ,
@@ -229,9 +225,7 @@ def test_no_sign_request(self):
229225 def test_no_paginate_arg (self ):
230226 d = tempfile .mkdtemp ()
231227 self .addCleanup (shutil .rmtree , d )
232- bucket_name = (
233- 'nopaginate' + str (int (time .time ())) + str (random .randint (1 , 100 ))
234- )
228+ bucket_name = random_bucket_name ('nopaginate' )
235229
236230 self .put_object (
237231 bucket = bucket_name , key = 'foobar' , content = 'foobar contents'
0 commit comments