Changeset 148
- Timestamp:
- 2002-03-31 20:36:28 (7 years ago)
- Files:
-
- trunk/_test_ftputil.py (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/_test_ftputil.py
r145 r148 30 30 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 31 32 # $Id: _test_ftputil.py,v 1.5 3 2002/03/30 22:48:53schwa Exp $32 # $Id: _test_ftputil.py,v 1.54 2002/03/31 20:36:28 schwa Exp $ 33 33 34 34 import unittest … … 258 258 259 259 def test_binary_write(self): 260 """Write binary data to the host and read it back."""260 """Write binary data with 'write'.""" 261 261 host = ftp_host_factory() 262 262 data = '\000a\001b\r\n\002c\003\n\004\r\005' … … 269 269 270 270 def test_ascii_write(self): 271 """Write an ASCII text to the host and check the written file."""271 """Write ASCII text with 'write'.""" 272 272 host = ftp_host_factory() 273 273 data = ' \nline 2\nline 3' … … 280 280 281 281 def test_ascii_writelines(self): 282 """Write ASCII data via writelines and check it."""282 """Write ASCII text with 'writelines'.""" 283 283 host = ftp_host_factory() 284 284 data = [' \n', 'line 2\n', 'line 3'] … … 294 294 295 295 def test_ascii_read(self): 296 """ Use plain ASCII read operations to get data."""296 """Read ASCII text with plain 'read'.""" 297 297 host = ftp_host_factory(session_factory=ReadMockSession) 298 298 input_ = host.file('dummy', 'r') … … 317 317 self.assertEqual(data, expected_data) 318 318 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 335 319 def test_binary_readline(self): 336 """ Use binary readline operations to get data."""320 """Read binary data with 'readline'.""" 337 321 host = ftp_host_factory(session_factory=ReadMockSession) 338 322 input_ = host.file('dummy', 'rb') … … 351 335 input_.close() 352 336 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 353 353 def test_ascii_readlines(self): 354 """ Use ASCII readline operations to get data."""354 """Read ASCII text with 'readlines'.""" 355 355 host = ftp_host_factory(session_factory=ReadMockSession) 356 356 input_ = host.file('dummy', 'r') … … 363 363 364 364 def test_ascii_xreadlines(self): 365 """ Use an xreadline-like object to retrieve ASCII data."""365 """Read ASCII text with 'xreadlines'.""" 366 366 host = ftp_host_factory(session_factory=ReadMockSession) 367 367 # open file, skip some bytes
