'Test the getDirectory method.
L{ftp.FTPClient.getDirectory} should return a Deferred which fires with
the current directory on the server. It wraps PWD command.'

def test_getDirectory(self):

    def cbGet(res):
        self.assertEqual(res, '/bar/baz')
    self._testLogin()
    d = self.client.getDirectory().addCallback(cbGet)
    self.assertEqual(self.transport.value(), 'PWD\r\n')
    self.client.lineReceived('257    "/bar/baz"')
    return d
