def test_init(self): mocked_monitor = Mock() # the call to be tested handler = EventHandler(mocked_monitor, 17) assert handler.verbosity == 17 assert handler.monitor is mocked_monitor
def test_init(self): mocked_monitor = Mock() # the call to be tested handler = EventHandler(mocked_monitor, 17) eq_(handler.verbosity, 17) ok_(handler.monitor is mocked_monitor)
def test_process_IN_MOVED_TO_2(self): mocked_monitor = Mock() event = Mock() event.dir = False event.pathname = 'hello' # the call to be tested handler = EventHandler(mocked_monitor, 17) handler.process_IN_DELETE(event) mocked_monitor._remove_cached.called_once_with(event.pathname)
def test_process_IN_MOVED_TO_1(self): mocked_monitor = Mock() event = Mock() event.dir = True event.pathname = 'hello' # the call to be tested handler = EventHandler(mocked_monitor, 17) handler.process_IN_DELETE(event) assert mocked_monitor._remove_cached.call_count == 0
def test_process_IN_CREATE_2(self): mocked_monitor = Mock() event = Mock() event.dir = False event.pathname = "hello" # the call to be tested handler = EventHandler(mocked_monitor, 17) handler.process_IN_DELETE(event) mocked_monitor._update_cache.called_once_with(event.pathname)
def test_process_IN_CREATE_1(self): mocked_monitor = Mock() event = Mock() event.dir = True event.pathname = "hello" # the call to be tested handler = EventHandler(mocked_monitor, 17) handler.process_IN_DELETE(event) assert mocked_monitor._update_cache.call_count == 0
def test_process_IN_MODIFY_2(self): mocked_monitor = mock.Mock() event = mock.Mock() event.dir = False event.pathname = "hello" # the call to be tested handler = EventHandler(mocked_monitor, 17) handler.process_IN_DELETE(event) mocked_monitor._remove_cached.called_once_with(event.pathname, True)