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

Method test_intersection_update

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

Source from the content-addressed store, hash-verified

502 self.assertIn(c, self.s)
503
504 def test_intersection_update(self):
505 retval = self.s.intersection_update(self.otherword)
506 self.assertEqual(retval, None)
507 for c in (self.word + self.otherword):
508 if c in self.otherword and c in self.word:
509 self.assertIn(c, self.s)
510 else:
511 self.assertNotIn(c, self.s)
512 self.assertRaises(PassThru, self.s.intersection_update, check_pass_thru())
513 self.assertRaises(TypeError, self.s.intersection_update, [[]])
514 for p, q in (('cdc', 'c'), ('efgfe', ''), ('ccb', 'bc'), ('ef', '')):
515 for C in set, frozenset, dict.fromkeys, str, list, tuple:
516 s = self.thetype('abcba')
517 self.assertEqual(s.intersection_update(C(p)), None)
518 self.assertEqual(s, set(q))
519 ss = 'abcba'
520 s = self.thetype(ss)
521 t = 'cbc'
522 self.assertEqual(s.intersection_update(C(p), C(t)), None)
523 self.assertEqual(s, set('abcba')&set(p)&set(t))
524
525 def test_iand(self):
526 self.s &= set(self.otherword)

Callers

nothing calls this directly

Calls 8

check_pass_thruFunction · 0.85
setFunction · 0.85
intersection_updateMethod · 0.80
assertInMethod · 0.80
assertNotInMethod · 0.80
CClass · 0.70
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected