Changeset 148

Show
Ignore:
Timestamp:
2002-03-31 20:36:28 (7 years ago)
Author:
schwa
Message:
TestFileOperations: unified docstrings of test methods.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/_test_ftputil.py

    r145 r148  
    3030# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
    3131 
    32 # $Id: _test_ftputil.py,v 1.53 2002/03/30 22:48:53 schwa Exp $ 
     32# $Id: _test_ftputil.py,v 1.54 2002/03/31 20:36:28 schwa Exp $ 
    3333 
    3434import unittest 
     
    258258 
    259259    def test_binary_write(self): 
    260         """Write binary data to the host and read it back.""" 
     260        """Write binary data with 'write'.""" 
    261261        host = ftp_host_factory() 
    262262        data = '\000a\001b\r\n\002c\003\n\004\r\005' 
     
    269269 
    270270    def test_ascii_write(self): 
    271         """Write an ASCII text to the host and check the written file.""" 
     271        """Write ASCII text with 'write'.""" 
    272272        host = ftp_host_factory() 
    273273        data = ' \nline 2\nline 3' 
     
    280280 
    281281    def test_ascii_writelines(self): 
    282         """Write ASCII data via writelines and check it.""" 
     282        """Write ASCII text with 'writelines'.""" 
    283283        host = ftp_host_factory() 
    284284        data = [' \n', 'line 2\n', 'line 3'] 
     
    294294 
    295295    def test_ascii_read(self): 
    296         """Use plain ASCII read operations to get data.""" 
     296        """Read ASCII text with plain 'read'.""" 
    297297        host = ftp_host_factory(session_factory=ReadMockSession) 
    298298        input_ = host.file('dummy', 'r') 
     
    317317        self.assertEqual(data, expected_data) 
    318318 
    319     def test_ascii_readline(self): 
    320         """Use ASCII readline operations to get data.""" 
    321         host = ftp_host_factory(session_factory=ReadMockSession) 
    322         input_ = host.file('dummy', 'r') 
    323         data = input_.readline(3) 
    324         self.assertEqual(data, 'lin') 
    325         data = input_.readline(10) 
    326         self.assertEqual(data, 'e 1\n') 
    327         data = input_.readline(13) 
    328         self.assertEqual(data, 'another line\n') 
    329         data = input_.readline() 
    330         self.assertEqual(data, 'yet another line') 
    331         data = input_.readline() 
    332         self.assertEqual(data, '') 
    333         input_.close() 
    334  
    335319    def test_binary_readline(self): 
    336         """Use binary readline operations to get data.""" 
     320        """Read binary data with 'readline'.""" 
    337321        host = ftp_host_factory(session_factory=ReadMockSession) 
    338322        input_ = host.file('dummy', 'rb') 
     
    351335        input_.close() 
    352336 
     337    def test_ascii_readline(self): 
     338        """Read ASCII text with 'readline'.""" 
     339        host = ftp_host_factory(session_factory=ReadMockSession) 
     340        input_ = host.file('dummy', 'r') 
     341        data = input_.readline(3) 
     342        self.assertEqual(data, 'lin') 
     343        data = input_.readline(10) 
     344        self.assertEqual(data, 'e 1\n') 
     345        data = input_.readline(13) 
     346        self.assertEqual(data, 'another line\n') 
     347        data = input_.readline() 
     348        self.assertEqual(data, 'yet another line') 
     349        data = input_.readline() 
     350        self.assertEqual(data, '') 
     351        input_.close() 
     352 
    353353    def test_ascii_readlines(self): 
    354         """Use ASCII readline operations to get data.""" 
     354        """Read ASCII text with 'readlines'.""" 
    355355        host = ftp_host_factory(session_factory=ReadMockSession) 
    356356        input_ = host.file('dummy', 'r') 
     
    363363 
    364364    def test_ascii_xreadlines(self): 
    365         """Use an xreadline-like object to retrieve ASCII data.""" 
     365        """Read ASCII text with 'xreadlines'.""" 
    366366        host = ftp_host_factory(session_factory=ReadMockSession) 
    367367        # open file, skip some bytes