MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_len

Method test_len

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

Source from the content-addressed store, hash-verified

474 self.assertEqual(d, deque())
475
476 def test_len(self):
477 d = deque('ab')
478 self.assertEqual(len(d), 2)
479 d.popleft()
480 self.assertEqual(len(d), 1)
481 d.pop()
482 self.assertEqual(len(d), 0)
483 self.assertRaises(IndexError, d.pop)
484 self.assertEqual(len(d), 0)
485 d.append('c')
486 self.assertEqual(len(d), 1)
487 d.appendleft('d')
488 self.assertEqual(len(d), 2)
489 d.clear()
490 self.assertEqual(len(d), 0)
491
492 def test_underflow(self):
493 d = deque()

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
popleftMethod · 0.80
appendleftMethod · 0.80
assertEqualMethod · 0.45
popMethod · 0.45
assertRaisesMethod · 0.45
appendMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected