MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / test_mixed_events_collected

Method test_mixed_events_collected

tests/test_watcher.py:113–125  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

111 handler._timer.cancel()
112
113 def test_mixed_events_collected(self):
114 callback = MagicMock()
115 handler = DebouncedHandler(callback, debounce_seconds=100)
116
117 handler.on_created(_make_file_event("/raw/new.pdf"))
118 handler.on_modified(_make_file_event("/raw/existing.md"))
119 handler.on_created(_make_file_event("/raw/.hidden")) # should be ignored
120 handler.on_created(_make_file_event("/raw/subdir", is_directory=True)) # ignored
121
122 if handler._timer:
123 handler._timer.cancel()
124
125 assert handler._pending == {"/raw/new.pdf", "/raw/existing.md"}

Callers

nothing calls this directly

Calls 4

on_createdMethod · 0.95
on_modifiedMethod · 0.95
DebouncedHandlerClass · 0.90
_make_file_eventFunction · 0.85

Tested by

no test coverage detected