#NEWLINE# def test_commit( self ) : #NEWLINE# #INDENT# key = self . mock_key ( self . manifest . journal_key ) #NEWLINE# key . set_contents_from_filename = Mock ( ) #NEWLINE# self . bucket . get = Mock ( return_value = key ) #NEWLINE# self . manifest . commit ( self . key_names ) #NEWLINE# self . database . open . assert_called_once_with ( ) #NEWLINE# inserts = [ call ( 'DELETE FROM journal' ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/00c68a1e-85f2-49e5-9d07-6922046dbc5a' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/19440481-7766-4061-bd42-4a54fa0aac7c' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/2014-09-02/19440481-7766-4061-bd42-4a54fa0aac7c' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/282e6063-ecef-4e45-bdfb-9fdfb39840cd' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/35cbf09a-b2dc-43f2-96f6-7d7573906268' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/80536e83-6bbe-4a42-ade1-533d99321a6c' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/cf00b394-3ff3-4418-b244-2ccf104fcc40' , ) ) , call ( 'INSERT INTO journal VALUES (?)' , ( 'object_path/e822e2ae-61f5-4be0-aacd-ca6de70faad1' , ) ) ] #NEWLINE# self . database . execute . assert_has_calls ( inserts ) #NEWLINE# self . database . commit . assert_called_once_with ( ) #NEWLINE# self . database . close . assert_called_once_with ( ) #NEWLINE# key . set_contents_from_filename . assert_called_once_with ( key . manifest . journal_file_name )