[pywin32-checkins] pywin32/win32/test test_win32gui.py,1.2,1.3
OLD project page for the Python extensions for Windows
                
                Brought to you by:
                
                    mhammond
                    
                
            
            
        
        
        
    | 
      
      
      From: Mark H. <mha...@us...> - 2009-02-09 12:41:28
      
     | 
| Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3684 Modified Files: test_win32gui.py Log Message: add missing import and buffer slice tests Index: test_win32gui.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_win32gui.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_win32gui.py 8 Feb 2009 09:59:19 -0000 1.2 --- test_win32gui.py 9 Feb 2009 12:41:23 -0000 1.3 *************** *** 5,8 **** --- 5,9 ---- import operator import array + import sys # theoretically should be in pywin32_testutil, but this is the only place *************** *** 39,42 **** --- 40,51 ---- got = win32gui.PyGetMemory(addr, buflen) self.failUnlessEqual(got[0], pywin32_testutil.str2bytes('\0')) + + def test_memory_slice(self): + # Check we can slice the buffer object returned by PyGetMemory + test_data = pywin32_testutil.str2bytes("\0\1\2\3\4\5\6") + c = array.array("b", test_data) + addr, buflen = c.buffer_info() + got = win32gui.PyGetMemory(addr, buflen) + self.failUnlessEqual(got[0:3], pywin32_testutil.str2bytes('\0\1\2')) def test_real_view(self): |