[Python-checkins] CVS: python/dist/src/Lib/test test_userlist.py,1.1,1.2

Jeremy Hylton python-dev@python.org
Thu, 30 Mar 2000 19:17:49 -0500


Update of /projects/cvsroot/python/dist/src/Lib/test
In directory goon.cnri.reston.va.us:/home/jhylton/python/src/Lib/test

Modified Files:
	test_userlist.py 
Log Message:
robustify UserList constructor -- will now accept any sequence
add test cases for non-UserList class, tuple, & string



Index: test_userlist.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/test/test_userlist.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_userlist.py	1999/03/26 16:20:42	1.1
--- test_userlist.py	2000/03/31 00:17:46	1.2
***************
*** 19,22 ****
--- 19,33 ----
  uu2 = UserList(u2)
  
+ v = UserList(tuple(u))
+ class OtherList:
+     def __init__(self, initlist):
+         self.__data = initlist
+     def __len__(self):
+         return len(self.__data)
+     def __getitem__(self, i):
+         return self.__data[i]
+ v0 = UserList(OtherList(u0))
+ vv = UserList("this is also a sequence")
+ 
  # Test __repr__