def test_failedAddWatch(self):
        """
        If C{inotify_add_watch} returns a negative number, L{add}
        raises L{INotifyError}.
        """
        class libc:
            def inotify_add_watch(self, fd, path, mask):
                return -1
        self.patch(_inotify, 'libc', libc())
        self.assertRaises(INotifyError, add, 3, FilePath('/foo'), 0)

        If C{inotify_add_watch} returns a negative number, L{add}
        raises L{INotifyError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/python/test/test_inotify.py