#NEWLINE# def test_policy_provided( self ) : #NEWLINE# #INDENT# policy = '{"notarealpolicy":true}' #NEWLINE# base64policy = base64 . encodestring ( six . b ( policy ) ) . strip ( ) . decode ( 'utf-8' ) #NEWLINE# policy_signature = 'a5SmoLOxoM0MHpOdC25nE7KIafg=' #NEWLINE# args = ' --instance-id i-12345678 --owner-akid AKIAIOSFODNN7EXAMPLE' #NEWLINE# args += ' --owner-sak wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' #NEWLINE# args += ( ' --bucket mybucket --prefix foobar --policy %s' % policy ) #NEWLINE# args_list = ( self . prefix + args ) . split ( ) #NEWLINE# result = { #NEWLINE# #INDENT# 'InstanceId' : 'i-12345678' , #NEWLINE# 'Storage' : { #NEWLINE# #INDENT# 'S3' : { #NEWLINE# #INDENT# 'Bucket' : 'mybucket' , #NEWLINE# 'Prefix' : 'foobar' , #NEWLINE# 'AWSAccessKeyId' : 'AKIAIOSFODNN7EXAMPLE' , #NEWLINE# 'UploadPolicy' : '{"notarealpolicy":true}' , #NEWLINE# 'UploadPolicySignature' : policy_signature , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# self . assert_params_for_cmd ( args_list , result )