def test_unconnectedFileDescriptor(self):
        """
        Verify that registering a producer when the connection has already
        been closed invokes its stopProducing() method.
        """
        fd = abstract.FileDescriptor()
        fd.disconnected = 1
        dp = DummyProducer()
        fd.registerProducer(dp, 0)
        self.assertEqual(dp.events, ['stop'])

        Verify that registering a producer when the connection has already
        been closed invokes its stopProducing() method.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_internet.py