twisted.pair.test.test_tuntap.TunnelDeviceTestsMixin(object) class documentationtwisted.pair.test.test_tuntap
(View In Hierarchy)
Known subclasses: twisted.pair.test.test_tuntap.FakeTapDeviceTests, twisted.pair.test.test_tuntap.FakeTapDeviceWithPITests, twisted.pair.test.test_tuntap.FakeTunDeviceTests, twisted.pair.test.test_tuntap.RealDeviceWithoutProtocolInformationTests, twisted.pair.test.test_tuntap.RealDeviceWithProtocolInformationTests
A mixin defining tests that apply to _IInputOutputSystem
implementations.
| Method | setUp | Create the _IInputOutputSystem
provider under test and open a tunnel using it. |
| Method | test_interface | The object under test provides _IInputOutputSystem. |
| Method | test_readEBADF | The device's read implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description). |
| Method | test_writeEBADF | The device's write implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description). |
| Method | test_closeEBADF | The device's close implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description). |
| Method | test_ioctlEBADF | The device's ioctl implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description). |
| Method | test_ioctlEINVAL | The device's ioctl implementation raises IOError
with an errno of EINVAL when called with a request (second
argument) which is not a supported operation. |
| Method | test_receive | If a UDP datagram is sent to an address reachable by the tunnel device then it can be read out of the tunnel device. |
| Method | test_send | If a UDP datagram is written the tunnel device then it is received by the network to which it is addressed. |
| Method | _invalidFileDescriptor | Get an invalid file descriptor. |
Get an invalid file descriptor.
| Returns | An integer which is not a valid file descriptor at the time of this call. After any future system call which allocates a new file descriptor, there is no guarantee the returned file descriptor will still be invalid. | |
The device's read implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description).
The device's write implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description).
The device's close implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description).
The device's ioctl implementation raises OSError
with an errno of EBADF when called on a file descriptor which
is not valid (ie, which has no associated file description).
The device's ioctl implementation raises IOError
with an errno of EINVAL when called with a request (second
argument) which is not a supported operation.