def test_modify(self):
        """
        Writing to a file in a monitored directory sends an
        C{inotify.IN_MODIFY} event to the callback.
        """
        def operation(path):
            with path.open("w") as fObj:
                fObj.write(b'foo')

        return self._notificationTest(inotify.IN_MODIFY, operation)

        Writing to a file in a monitored directory sends an
        C{inotify.IN_MODIFY} event to the callback.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_inotify.py