def test_get_destination_path_file_doesnt_exist(self, exists): exists.return_value = False assert_that( model.get_destination_path( source='origin/path.jpg', dest='dest/path', extension='.jpg'), is_('dest/path.jpg')) exists.assert_called_with('dest/path.jpg')
def test_get_destination_path_file_exist_with_same_file_content(self, exists, samefile, filecmp): samefile.return_value = False filecmp.return_value = True exists.side_effect = [ True ] assert_that( model.get_destination_path( source='origin/path.jpg', dest='dest/path', extension='.jpg'), is_('dest/path.jpg')) exists.has_calls([ mock.call('dest/path.jpg'), ])