def test_openForWriting(self):
        """
        Check that openForWriting returns an object providing C{ftp.IWriteFile}.
        """
        d = self.shell.openForWriting(('foo',))
        def cb1(res):
            self.assertTrue(ftp.IWriteFile.providedBy(res))
            return res.receive().addCallback(cb2)
        def cb2(res):
            self.assertTrue(IConsumer.providedBy(res))
        d.addCallback(cb1)
        return d

        Check that openForWriting returns an object providing C{ftp.IWriteFile}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py