#NEWLINE# @ mock_sqs #NEWLINE# def test_change_message_visibility_on_visible_message( ) : #NEWLINE# #INDENT# conn = boto . connect_sqs ( 'the_key' , 'the_secret' ) #NEWLINE# queue = conn . create_queue ( 'test-queue' , visibility_timeout = 1 ) #NEWLINE# queue . set_message_class ( RawMessage ) #NEWLINE# queue . write ( queue . new_message ( 'this is another test message' ) ) #NEWLINE# queue . count ( ) . should . equal ( 1 ) #NEWLINE# messages = conn . receive_message ( queue , number_messages = 1 ) #NEWLINE# assert ( len ( messages ) == 1 ) #NEWLINE# original_message = messages [ 0 ] #NEWLINE# queue . count ( ) . should . equal ( 0 ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# queue . count ( ) . should . equal ( 1 ) #NEWLINE# original_message . change_visibility . when . called_with ( 100 ) . should . throw ( SQSError )