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

Method test_and

Lib/test/test_enum.py:3632–3648  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3630 self.assertIs(Open.RO | Open.CE, Open.CE)
3631
3632 def test_and(self):
3633 Perm = self.Perm
3634 RW = Perm.R | Perm.W
3635 RX = Perm.R | Perm.X
3636 WX = Perm.W | Perm.X
3637 RWX = Perm.R | Perm.W | Perm.X
3638 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
3639 for i in values:
3640 for j in values:
3641 self.assertEqual((i & j).value, i.value & j.value)
3642 self.assertIs(type(i & j), Perm)
3643 for i in Perm:
3644 self.assertIs(i & i, i)
3645 self.assertIs(i & RWX, i)
3646 self.assertIs(RWX & i, i)
3647 Open = self.Open
3648 self.assertIs(Open.RO & Open.CE, Open.RO)
3649
3650 def test_xor(self):
3651 Perm = self.Perm

Callers

nothing calls this directly

Calls 4

listClass · 0.85
PermClass · 0.70
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected