MCPcopy Index your code
hub / github.com/python/cpython / test_reverse

Method test_reverse

Lib/test/test_deque.py:411–421  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

409 self.assertEqual(len(d), 0)
410
411 def test_reverse(self):
412 n = 500 # O(n**2) test, don't make this too big
413 data = [random.random() for i in range(n)]
414 for i in range(n):
415 d = deque(data[:i])
416 r = d.reverse()
417 self.assertEqual(list(d), list(reversed(data[:i])))
418 self.assertIs(r, None)
419 d.reverse()
420 self.assertEqual(list(d), data[:i])
421 self.assertRaises(TypeError, d.reverse, 1) # Arity is zero
422
423 def test_rotate(self):
424 s = tuple('abcde')

Callers

nothing calls this directly

Calls 6

listClass · 0.85
randomMethod · 0.45
reverseMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected