def test_openDirectoryIteratorDeprecated(self):
        """
        Using client.openDirectory as an iterator is deprecated.
        """
        d = self.client.openDirectory(b'')
        self._emptyBuffers()
        openDir = yield d
        openDir.next()

        warnings = self.flushWarnings()
        message = (
            'Using twisted.conch.ssh.filetransfer.ClientDirectory'
            ' as an iterator was deprecated in Twisted 18.9.0.'
            )
        self.assertEqual(1, len(warnings))
        self.assertEqual(DeprecationWarning, warnings[0]['category'])
        self.assertEqual(message, warnings[0]['message'])

        Using client.openDirectory as an iterator is deprecated.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/test/test_filetransfer.py