'Test whether batch file function of cftp (\'cftp -b batchfile\').
This works by treating the file as a list of commands to be run.'

def testBatchFile(self):

    cmds = 'pwd\nls\nexit\n'
    def _cbCheckResult(res):
        res = res.split('\n')
        log.msg(('RES    %s' % repr(res)))
        self.assertIn(self.testDir.asBytesMode().path, res[1])
        self.assertEqual(res[3:(-2)], ['testDirectory', 'testRemoveFile', 'testRenameFile', 'testfile1'])
    d = self._getBatchOutput(cmds)
    d.addCallback(_cbCheckResult)
    return d
