Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
    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
Ejemplo n.º 3
0
    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
Ejemplo n.º 4
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)
Ejemplo n.º 5
0
    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
Ejemplo n.º 6
0
    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)

        eq_(mocked_monitor._update_cache.call_count, 0)
Ejemplo n.º 7
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)
Ejemplo n.º 8
0
    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
        )
Ejemplo n.º 9
0
    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)