Ticket #4386: 4386.2.patch

File 4386.2.patch, 2.0 KB (added by moijes12, 5 years ago)

Here's another one.

  • twisted/topfiles/4386.bugfix

     
     1twisted.internet.abstract.FileDescriptor implements twisted.internet.interfaces.IPushProducer instead of twisted.internet.interfaces.IProducer.
  • twisted/internet/abstract.py

     
    155155
    156156    SEND_LIMIT = 128*1024
    157157
    158     implements(interfaces.IProducer, interfaces.IReadWriteDescriptor,
     158    implements(interfaces.IPushProducer, interfaces.IReadWriteDescriptor,
    159159               interfaces.IConsumer, interfaces.ITransport, interfaces.IHalfCloseableDescriptor)
    160160
    161161    def __init__(self, reactor=None):
  • twisted/internet/test/test_filedescriptor.py

     
    55Whitebox tests for L{twisted.internet.abstract.FileDescriptor}.
    66"""
    77
     8from zope.interface.verify import verifyClass
     9
    810from twisted.internet.abstract import FileDescriptor
     11from twisted.internet.interfaces import IPushProducer
    912from twisted.trial.unittest import TestCase
    1013
    1114
    1215
    13 class FileDescriptorWriteSequenceTests(TestCase):
     16class FileDescriptorTests(TestCase):
    1417    """
    15     Tests for L{FileDescriptor.writeSequence}.
     18    Tests for L{FileDescriptor}.
    1619    """
    1720    def test_writeWithUnicodeRaisesException(self):
    1821        """
     
    2932        fileDescriptor = FileDescriptor()
    3033        self.assertRaises(
    3134            TypeError, fileDescriptor.writeSequence, ['foo', u'bar', 'baz'])
     35
     36
     37    def test_fileDescriptorImplementsIPushProducer(self):
     38        """
     39        L{FileDescriptor} implements L{IPushProducer}
     40        """
     41        self.assertTrue(verifyClass(IPushProducer, FileDescriptor))