'Check that \'put\' uploads files correctly and that they can be
successfully removed. Also check the output of the put command.'

def testPut(self):

    expectedOutput = (((('Transferred    ' + self.testDir.asBytesMode().path) + '/testfile1    to    ') + self.testDir.asBytesMode().path) + '/test"file2')
    def _checkPut(result):
        self.assertFilesEqual(self.testDir.child('testfile1'), self.testDir.child('test"file2'))
        self.assertTrue(result.endswith(expectedOutput))
        return self.runCommand('rm    "test\\"file2"')
    d = self.runCommand(('put    %s/testfile1    "test\\"file2"' % (self.testDir.path,)))
    d.addCallback(_checkPut)
    d.addCallback((lambda _: self.assertFalse(self.testDir.child('test"file2').exists())))
    return d
