[Python-checkins] python/dist/src/Lib/test test_deque.py,1.3,1.4
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Sat Feb 7 16:13:02 EST 2004
Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8513/Lib/test
Modified Files:
test_deque.py
Log Message:
* Incorporate Skip's suggestions for documentation (explain the word deque
comes from and show the differences from lists).
* Add a rotate() method.
Index: test_deque.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_deque.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** test_deque.py 7 Feb 2004 02:45:21 -0000 1.3
--- test_deque.py 7 Feb 2004 21:12:59 -0000 1.4
***************
*** 41,44 ****
--- 41,56 ----
self.assertEqual(list(d), list(reversed('abcd')))
+ def test_rotate(self):
+ s = 'abcde'
+ d = deque(s)
+ d.rotate(2)
+ self.assertEqual(''.join(d), 'deabc')
+ d.rotate(3)
+ self.assertEqual(''.join(d), s)
+ d.rotate(-3)
+ self.assertEqual(''.join(d), 'deabc')
+ d.rotate(-15)
+ self.assertEqual(''.join(d), 'deabc')
+
def test_len(self):
d = deque('ab')
More information about the Python-checkins
mailing list