def test_failedMakeDirectory(self):
        """
        L{ftp.FTPClient.makeDirectory} returns a L{Deferred} which is errbacked
        with L{CommandFailed} if the server returns an error response code.
        """
        self._testLogin()

        d = self.client.makeDirectory("/spam")
        self.assertEqual(self.transport.value(), b'MKD /spam\r\n')
        self.client.lineReceived(b'550 PERMISSION DENIED')
        return self.assertFailure(d, ftp.CommandFailed)

        L{ftp.FTPClient.makeDirectory} returns a L{Deferred} which is errbacked
        with L{CommandFailed} if the server returns an error response code.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_ftp.py