def test_failedGetDirectory(self):
        """
        Test a failure in getDirectory method.

        The behaviour should be the same as PWD.
        """
        self._testLogin()
        d = self.client.getDirectory()
        self.assertFailure(d, ftp.CommandFailed)
        self.assertEqual(self.transport.value(), b'PWD\r\n')
        self.client.lineReceived(b'550 /bar/baz: No such file or directory')
        return d

        Test a failure in getDirectory method.

        The behaviour should be the same as PWD.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py