示例#1
0
 def testGetFile(self):
     """Test that the ftp client can fetch a file ok"""
     myClient = FtpClient()
     myListing = myClient.getListing()
     # Make it a single string
     myListing = "\n".join(myListing)
     myMessage = "Expected outcome:\n%s\nActual outcome:\n%s" % (myListing, self._expectedMatches)
     for myExpectedFile in self._expectedMatches:
         assert re.search(myExpectedFile, myListing), myMessage
示例#2
0
 def testGetDirectoryListing(self):
     """Check if we can get a nice directory listing"""
     myClient = FtpClient()
     myListing = myClient.getListing()
     # Make it a single string
     myListing = "\n".join(myListing)
     myMessage = "Expected this list:\n%s\nTo contain these items:\n%s" % (myListing, self._expectedMatches)
     for myExpectedFile in self._expectedMatches:
         assert re.search(myExpectedFile, myListing), myMessage
示例#3
0
 def testGetFile(self):
     """Test that the ftp client can fetch a file ok"""
     myClient = FtpClient()
     myListing = myClient.getListing()
     #Make it a single string
     myListing = '\n'.join(myListing)
     myMessage = (
         'Expected outcome:\n%s\nActual outcome:\n%s' %
         (myListing, self._expectedMatches))
     for myExpectedFile in self._expectedMatches:
         assert re.search(myExpectedFile, myListing), myMessage
示例#4
0
 def testGetDirectoryListing(self):
     """Check if we can get a nice directory listing"""
     myClient = FtpClient()
     myListing = myClient.getListing()
     #Make it a single string
     myListing = '\n'.join(myListing)
     myMessage = (
         'Expected this list:\n%s\nTo contain these items:\n%s' %
         (myListing, self._expectedMatches))
     for myExpectedFile in self._expectedMatches:
         assert re.search(myExpectedFile, myListing), myMessage