def test_event_handler_delete_self(mock_configs_file_watcher, mock_event,
                                   deleted_folder):
    event_handler = _EventHandler(cache=mock_configs_file_watcher)
    mock_event.pathname = deleted_folder
    event_handler.process_IN_DELETE_SELF(event=mock_event)
    assert mock_configs_file_watcher._needs_reconfigure == (
        deleted_folder == '/foo')
def test_event_handler_move(mock_configs_file_watcher, mock_event):
    event_handler = _EventHandler(cache=mock_configs_file_watcher)
    event_handler.process_IN_MOVED_TO(event=mock_event)
    mock_configs_file_watcher._maybe_add_path_to_cache.assert_called_once_with(mock_event.pathname)
def test_event_handler_delete_self(mock_configs_file_watcher, mock_event):
    event_handler = _EventHandler(cache=mock_configs_file_watcher)
    event_handler.process_IN_DELETE_SELF(event=mock_event)
    mock_configs_file_watcher.setup.assert_called_once_with()
def test_event_handler_overflow(mock_configs_file_watcher, mock_event):
    event_handler = _EventHandler(cache=mock_configs_file_watcher)
    event_handler.process_IN_Q_OVERFLOW(event=mock_event)
    mock_configs_file_watcher.setup.assert_called_once_with()
def test_event_handler_delete(mock_configs_file_watcher, mock_event):
    event_handler = _EventHandler(cache=mock_configs_file_watcher)
    event_handler.process_IN_DELETE(event=mock_event)
    mock_configs_file_watcher._maybe_remove_path_from_cache.assert_called_once_with(mock_event.pathname)
def test_event_handler_overflow(mock_configs_file_watcher, mock_event):
    event_handler = _EventHandler(cache=mock_configs_file_watcher)
    event_handler.process_IN_Q_OVERFLOW(event=mock_event)
    assert mock_configs_file_watcher._needs_reconfigure