#NEWLINE# def test_publish_cmd( self ) : #NEWLINE# #INDENT# with mock_s3 ( ) : #NEWLINE# #INDENT# conn = boto . connect_s3 ( ) #NEWLINE# bucket = conn . create_bucket ( settings . AWS_BUCKET_NAME ) #NEWLINE# call_command ( 'build' ) #NEWLINE# call_command ( 'publish' , no_pooling = True , verbosity = 3 ) #NEWLINE# local_file_list = [ ] #NEWLINE# for ( dirpath , dirnames , filenames ) in os . walk ( settings . BUILD_DIR ) : #NEWLINE# #INDENT# for fname in filenames : #NEWLINE# #INDENT# local_key = os . path . join ( os . path . relpath ( dirpath , settings . BUILD_DIR ) , fname ) #NEWLINE# if local_key . startswith ( './' ) : #NEWLINE# #INDENT# local_key = filenames [ 2 : ] #NEWLINE# #UNINDENT# local_file_list . append ( local_key ) #NEWLINE# #UNINDENT# #UNINDENT# for key in bucket . list ( ) : #NEWLINE# #INDENT# self . assertIn ( key . name , local_file_list ) #NEWLINE# #UNINDENT# call_command ( 'unbuild' ) #NEWLINE# os . makedirs ( settings . BUILD_DIR ) #NEWLINE# call_command ( 'publish' , no_pooling = True , verbosity = 3 )