1
# Copyright (c) 2009 Twisted Matrix Laboratories.
2
# See LICENSE for details.
5
Tests for L{twisted.internet._pollingfile}.
8
from twisted.python.runtime import platform
9
from twisted.trial.unittest import TestCase
11
if platform.isWindows():
12
from twisted.internet import _pollingfile
18
class TestPollableWritePipe(TestCase):
20
Tests for L{_pollingfile._PollableWritePipe}.
23
def test_checkWorkUnicode(self):
25
When one tries to pass unicode to L{_pollingfile._PollableWritePipe}, a
26
C{TypeError} is raised instead of passing the data to C{WriteFile}
27
call which is going to mangle it.
29
p = _pollingfile._PollableWritePipe(1, lambda: None)
34
self.assertRaises(TypeError, p.checkWork)
38
if _pollingfile is None:
39
TestPollableWritePipe.skip = "_pollingfile is only avalable under Windows."