[Python-checkins] CVS: python/dist/src/Lib/test test_mmap.py,1.7,1.8

Mark Hammond python-dev@python.org
Sat, 29 Jul 2000 19:20:40 -0700


Update of /cvsroot/python/python/dist/src/Lib/test
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4458

Modified Files:
	test_mmap.py 
Log Message:
Test that after resizing the mmap'd file, we can't seek beyond the new size.

Index: test_mmap.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mmap.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** test_mmap.py	2000/07/11 11:24:41	1.7
--- test_mmap.py	2000/07/30 02:20:38	1.8
***************
*** 106,110 ****
      else:
          # resize() is supported
!         pass
      
      m.close()
--- 106,117 ----
      else:
          # resize() is supported
! 	assert len(m) == 512, "len(m) is %d, but expecting 512" % (len(m),)
! 	# Check that we can no longer seek beyond the new size.
! 	try:
! 		m.seek(513,0)
! 	except ValueError:
! 		pass
! 	else:
! 	        assert 0, 'Could seek beyond the new size'
      
      m.close()