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

Method test_isdisjoint_Set

Lib/test/test_collections.py:1449–1463  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1447 self.assertTrue(hash(a) == hash(b))
1448
1449 def test_isdisjoint_Set(self):
1450 class MySet(Set):
1451 def __init__(self, itr):
1452 self.contents = itr
1453 def __contains__(self, x):
1454 return x in self.contents
1455 def __iter__(self):
1456 return iter(self.contents)
1457 def __len__(self):
1458 return len([x for x in self.contents])
1459 s1 = MySet((1, 2, 3))
1460 s2 = MySet((4, 5, 6))
1461 s3 = MySet((1, 5, 6))
1462 self.assertTrue(s1.isdisjoint(s2))
1463 self.assertFalse(s1.isdisjoint(s3))
1464
1465 def test_equality_Set(self):
1466 class MySet(Set):

Callers

nothing calls this directly

Calls 4

assertTrueMethod · 0.80
assertFalseMethod · 0.80
MySetClass · 0.70
isdisjointMethod · 0.45

Tested by

no test coverage detected