(self)
| 109 | self.fail("s|t did not screen-out general iterables") |
| 110 | |
| 111 | def test_intersection(self): |
| 112 | i = self.s.intersection(self.otherword) |
| 113 | for c in self.letters: |
| 114 | self.assertEqual(c in i, c in self.d and c in self.otherword) |
| 115 | self.assertEqual(self.s, self.thetype(self.word)) |
| 116 | self.assertEqual(type(i), self.basetype) |
| 117 | self.assertRaises(PassThru, self.s.intersection, check_pass_thru()) |
| 118 | for C in set, frozenset, dict.fromkeys, str, list, tuple: |
| 119 | self.assertEqual(self.thetype('abcba').intersection(C('cdc')), set('cc')) |
| 120 | self.assertEqual(self.thetype('abcba').intersection(C('efgfe')), set('')) |
| 121 | self.assertEqual(self.thetype('abcba').intersection(C('ccb')), set('bc')) |
| 122 | self.assertEqual(self.thetype('abcba').intersection(C('ef')), set('')) |
| 123 | self.assertEqual(self.thetype('abcba').intersection(C('cbcf'), C('bag')), set('b')) |
| 124 | s = self.thetype('abcba') |
| 125 | z = s.intersection() |
| 126 | if self.thetype == frozenset(): |
| 127 | self.assertEqual(id(s), id(z)) |
| 128 | else: |
| 129 | self.assertNotEqual(id(s), id(z)) |
| 130 | |
| 131 | def test_isdisjoint(self): |
| 132 | def f(s1, s2): |
nothing calls this directly
no test coverage detected