#NEWLINE# @ mock_sqs #NEWLINE# def test_send_message_with_delay( ) : #NEWLINE# #INDENT# conn = boto . connect_sqs ( 'the_key' , 'the_secret' ) #NEWLINE# queue = conn . create_queue ( 'test-queue' , visibility_timeout = 60 ) #NEWLINE# queue . set_message_class ( RawMessage ) #NEWLINE# body_one = 'this is a test message' #NEWLINE# body_two = 'this is another test message' #NEWLINE# queue . write ( queue . new_message ( body_one ) , delay_seconds = 60 ) #NEWLINE# queue . write ( queue . new_message ( body_two ) ) #NEWLINE# queue . count ( ) . should . equal ( 1 ) #NEWLINE# messages = conn . receive_message ( queue , number_messages = 2 ) #NEWLINE# assert ( len ( messages ) == 1 ) #NEWLINE# message = messages [ 0 ] #NEWLINE# assert message . get_body ( ) . should . equal ( body_two ) #NEWLINE# queue . count ( ) . should . equal ( 0 )