'Test that \'get\' saves the remote file to the correct local location,
that the output of \'get\' is correct and that \'rm\' actually removes
the file.'

def testGet(self):

    expectedOutput = ('Transferred    %s/testfile1    to    %s/test    file2' % (self.testDir.path, self.testDir.path))
    if isinstance(expectedOutput, unicode):
        expectedOutput = expectedOutput.encode('utf-8')
    def _checkGet(result):
        self.assertTrue(result.endswith(expectedOutput))
        self.assertFilesEqual(self.testDir.child('testfile1'), self.testDir.child('test    file2'), 'get    failed')
        return self.runCommand('rm    "test    file2"')
    d = self.runCommand(('get    testfile1    "%s/test    file2"' % (self.testDir.path,)))
    d.addCallback(_checkGet)
    d.addCallback((lambda _: self.assertFalse(self.testDir.child('test    file2').exists())))
    return d
