# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.

"""
Tests for L{twisted.python._inotify}.
"""

from twisted.trial.unittest import TestCase
from twisted.python.runtime import platform

if platform.supportsINotify():
    from ctypes import c_int, c_char_p
    from twisted.python import _inotify
    from twisted.python._inotify import (
        INotifyError, initializeModule, init, add)
else:
    _inotify = None



class INotifyTests(TestCase):
    """
    Tests for L{twisted.python._inotify}.
    """
    if _inotify is None:
        skip = "This platform doesn't support INotify."

    def test_missingInit(self):
        """
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_init} attribute, L{ImportError} is raised.
Exemple #2
0
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python._inotify}.
"""

from twisted.trial.unittest import TestCase
from twisted.python.filepath import FilePath
from twisted.python.runtime import platform

if platform.supportsINotify():
    from ctypes import c_int, c_uint32, c_char_p
    from twisted.python import _inotify
    from twisted.python._inotify import (INotifyError, initializeModule, init,
                                         add)
else:
    _inotify = None  # type: ignore[assignment]


class INotifyTests(TestCase):
    """
    Tests for L{twisted.python._inotify}.
    """
    if _inotify is None:
        skip = "This platform doesn't support INotify."

    def test_missingInit(self):
        """
        If the I{libc} object passed to L{initializeModule} has no
        C{inotify_init} attribute, L{ImportError} is raised.
        """
"""
Tests for L{twisted.python._inotify}.
"""

from twisted.python.filepath import FilePath
from twisted.python.runtime import platform
from twisted.trial.unittest import TestCase

try:
    from twisted.python import _inotify
except ImportError:
    inotify = None
else:
    inotify = _inotify

if inotify and platform.supportsINotify():
    from ctypes import c_char_p, c_int, c_uint32

    from twisted.python._inotify import INotifyError, add, init, initializeModule
else:
    inotify = None


class INotifyTests(TestCase):
    """
    Tests for L{twisted.python._inotify}.
    """

    if inotify is None:
        skip = "This platform doesn't support INotify."