def test_failedPWD(self):
        """
        Test a failure in PWD command.

        When the PWD command fails, the returned Deferred should errback
        with L{ftp.CommandFailed}.
        """
        self._testLogin()
        d = self.client.pwd()
        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 PWD command.

        When the PWD command fails, the returned Deferred should errback
        with L{ftp.CommandFailed}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py