'LIST returns all folder\'s members, each member listed on a separate
line and with name and other details.'

def test_LISTWithContent(self):

    os.mkdir(os.path.join(self.directory, 'foo'))
    os.mkdir(os.path.join(self.directory, 'bar'))
    d = self._anonymousLogin()
    self._download('LIST', chainDeferred=d)
    def checkDownload(download):
        self.assertEqual(2, len(download[:(-2)].split('\r\n')))
    d.addCallback(checkDownload)
    self._download('NLST    ', chainDeferred=d)
    def checkDownload(download):
        filenames = download[:(-2)].split('\r\n')
        filenames.sort()
        self.assertEqual(['bar', 'foo'], filenames)
    d.addCallback(checkDownload)
    self._download('LIST    foo', chainDeferred=d)
    def checkDownload(download):
        self.assertEqual('', download)
    d.addCallback(checkDownload)
    def chdir(ignored):
        return self.client.queueStringCommand('CWD    foo')
    d.addCallback(chdir)
    self._download('LIST', chainDeferred=d)
    def checkDownload(download):
        self.assertEqual('', download)
    return d.addCallback(checkDownload)
