[pywin32-checkins] pywin32/com/win32com/test testvb.py,1.14,1.15
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: <mha...@us...> - 2003-10-23 07:38:11
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test
In directory sc8-pr-cvs1:/tmp/cvs-serv28498
Modified Files:
testvb.py
Log Message:
Add some enumerator tests.
Index: testvb.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testvb.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** testvb.py 20 Oct 2003 10:01:45 -0000 1.14
--- testvb.py 23 Oct 2003 07:06:27 -0000 1.15
***************
*** 233,236 ****
--- 233,256 ----
if check != list(expected):
raise error, "Collection %s didn't have %r (had %r)" % (col_name, expected, check)
+ # Just looping over the collection again works (ie, is restartable)
+ check = []
+ for item in c:
+ check.append(item)
+ if check != list(expected):
+ raise error, "Collection 2nd time around %s didn't have %r (had %r)" % (col_name, expected, check)
+ # Check we can get it via iter()
+ i = iter(getattr(vbtest, col_name))
+ check = []
+ for item in i:
+ check.append(item)
+ if check != list(expected):
+ raise error, "Collection iterator %s didn't have %r 2nd time around (had %r)" % (col_name, expected, check)
+ # but an iterator is not restartable
+ check = []
+ for item in i:
+ check.append(item)
+ if check != []:
+ raise error, "2nd time around Collection iterator %s wasn't empty (had %r)" % (col_name, check)
+
# Check len()==Count()
c = getattr(vbtest, col_name)
|