/[rdiff-backup]/rdiff-backup/testing/iterfiletest.py
ViewVC logotype

Diff of /rdiff-backup/testing/iterfiletest.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by bescoto, Tue Mar 4 21:10:38 2003 UTC revision 1.7 by bescoto, Tue Oct 25 02:38:17 2005 UTC
# Line 41  class testIterFile(unittest.TestCase): Line 41  class testIterFile(unittest.TestCase):
41    
42          def testFileException(self):          def testFileException(self):
43                  """Test encoding a file which raises an exception"""                  """Test encoding a file which raises an exception"""
44                  f = FileException(100*1024)                  f = FileException(200*1024) # size depends on buffer size
45                  new_iter = IterWrappingFile(FileWrappingIter(iter([f, "foo"])))                  new_iter = IterWrappingFile(FileWrappingIter(iter([f, "foo"])))
46                  f_out = new_iter.next()                  f_out = new_iter.next()
47                  assert f_out.read(10000) == "a"*10000                  assert f_out.read(50000) == "a"*50000
48                  try: buf = f_out.read(100*1024)                  try: buf = f_out.read(190*1024)
49                  except IOError: pass                  except IOError: pass
50                  else: assert 0, len(buf)                  else: assert 0, len(buf)
51    

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26