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

Method test_update

Lib/test/test_set.py:480–497  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

478 self.assertRaises(KeyError, self.s.pop)
479
480 def test_update(self):
481 retval = self.s.update(self.otherword)
482 self.assertEqual(retval, None)
483 for c in (self.word + self.otherword):
484 self.assertIn(c, self.s)
485 self.assertRaises(PassThru, self.s.update, check_pass_thru())
486 self.assertRaises(TypeError, self.s.update, [[]])
487 for p, q in (('cdc', 'abcd'), ('efgfe', 'abcefg'), ('ccb', 'abc'), ('ef', 'abcef')):
488 for C in set, frozenset, dict.fromkeys, str, list, tuple:
489 s = self.thetype('abcba')
490 self.assertEqual(s.update(C(p)), None)
491 self.assertEqual(s, set(q))
492 for p in ('cdc', 'efgfe', 'ccb', 'ef', 'abcda'):
493 q = 'ahi'
494 for C in set, frozenset, dict.fromkeys, str, list, tuple:
495 s = self.thetype('abcba')
496 self.assertEqual(s.update(C(p), C(q)), None)
497 self.assertEqual(s, set(s) | set(p) | set(q))
498
499 def test_ior(self):
500 self.s |= set(self.otherword)

Callers

nothing calls this directly

Calls 7

check_pass_thruFunction · 0.85
setFunction · 0.85
assertInMethod · 0.80
CClass · 0.70
updateMethod · 0.45
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected