diff options
author | Raymond Hettinger <python@rcn.com> | 2004-09-30 07:47:20 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-09-30 07:47:20 (GMT) |
commit | 5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa (patch) | |
tree | 5a307e19aaad9cebe2aa63d94194fd3052581926 /Lib/test/list_tests.py | |
parent | f751fa61950c08424c369d32c42c978c492154bc (diff) | |
download | cpython-5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa.zip cpython-5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa.tar.gz cpython-5ea7e31076ad80af028d6cb0fa5d4e17f2b467fa.tar.bz2 |
Improve test coverage.
Diffstat (limited to 'Lib/test/list_tests.py')
-rw-r--r-- | Lib/test/list_tests.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index 3780b86..e616c79 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -29,14 +29,6 @@ class CommonTest(seq_tests.CommonTest): self.assertNotEqual(id(a), id(b)) self.assertEqual(a, b) - def test_mul(self): - for m in xrange(4): - s = tuple(range(m)) - for n in xrange(-3, 5): - self.assertEqual(self.type2test(s*n), self.type2test(s)*n) - self.assertEqual(self.type2test(s)*(-4), self.type2test([])) - self.assertEqual(id(s), id(s*1)) - def test_repr(self): l0 = [] l2 = [0, 1, 2] @@ -70,31 +62,6 @@ class CommonTest(seq_tests.CommonTest): fo.close() os.remove(test_support.TESTFN) - def test_getitem(self): - a = self.type2test([10, 11]) - self.assertEqual(a[0], 10) - self.assertEqual(a[1], 11) - self.assertEqual(a[-2], 10) - self.assertEqual(a[-1], 11) - self.assertRaises(IndexError, a.__getitem__, -3) - self.assertRaises(IndexError, a.__getitem__, 3) - - def test_subscript(self): - a = self.type2test([10, 11]) - self.assertEqual(a.__getitem__(0L), 10) - self.assertEqual(a.__getitem__(1L), 11) - self.assertEqual(a.__getitem__(-2L), 10) - self.assertEqual(a.__getitem__(-1L), 11) - self.assertRaises(IndexError, a.__getitem__, -3) - self.assertRaises(IndexError, a.__getitem__, 3) - self.assertEqual(a.__getitem__(slice(0,1)), self.type2test([10])) - self.assertEqual(a.__getitem__(slice(1,2)), self.type2test([11])) - self.assertEqual(a.__getitem__(slice(0,2)), self.type2test([10, 11])) - self.assertEqual(a.__getitem__(slice(0,3)), self.type2test([10, 11])) - self.assertEqual(a.__getitem__(slice(3,5)), self.type2test([])) - self.assertRaises(ValueError, a.__getitem__, slice(0, 10, 0)) - self.assertRaises(TypeError, a.__getitem__, 'x') - def test_set_subscript(self): a = self.type2test(range(20)) self.assertRaises(ValueError, a.__setitem__, slice(0, 10, 0), [1,2,3]) |