'Test that \'pwd\' reports the current remote directory, that \'lpwd\'
reports the current local directory, and that changing to a
subdirectory then changing to its parent leaves you in the original
remote directory.'

def testCdPwd(self):

    homeDir = self.testDir
    d = self.runScript('pwd', 'lpwd', 'cd    testDirectory', 'cd    ..', 'pwd')
    def cmdOutput(output):
        '\n                                                Callback    function    for    handling    command    output.\n                                                '
        cmds = []
        for cmd in output:
            if (_PY3 and isinstance(cmd, bytes)):
                cmd = cmd.decode('utf-8')
            cmds.append(cmd)
        return (cmds[:3] + cmds[4:])
    d.addCallback(cmdOutput)
    d.addCallback(self.assertEqual, [homeDir.path, os.getcwd(), '', homeDir.path])
    return d
