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

Method test_equality_Set

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

Source from the content-addressed store, hash-verified

1463 self.assertFalse(s1.isdisjoint(s3))
1464
1465 def test_equality_Set(self):
1466 class MySet(Set):
1467 def __init__(self, itr):
1468 self.contents = itr
1469 def __contains__(self, x):
1470 return x in self.contents
1471 def __iter__(self):
1472 return iter(self.contents)
1473 def __len__(self):
1474 return len([x for x in self.contents])
1475 s1 = MySet((1,))
1476 s2 = MySet((1, 2))
1477 s3 = MySet((3, 4))
1478 s4 = MySet((3, 4))
1479 self.assertTrue(s2 > s1)
1480 self.assertTrue(s1 < s2)
1481 self.assertFalse(s2 <= s1)
1482 self.assertFalse(s2 <= s3)
1483 self.assertFalse(s1 >= s2)
1484 self.assertEqual(s3, s4)
1485 self.assertNotEqual(s2, s3)
1486
1487 def test_arithmetic_Set(self):
1488 class MySet(Set):

Callers

nothing calls this directly

Calls 5

assertTrueMethod · 0.80
assertFalseMethod · 0.80
assertNotEqualMethod · 0.80
MySetClass · 0.70
assertEqualMethod · 0.45

Tested by

no test coverage detected