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

Method test_invert

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

Source from the content-addressed store, hash-verified

4246 self.assertIs(Open.CE ^ Open.CE, Open.RO)
4247
4248 def test_invert(self):
4249 Perm = self.Perm
4250 RW = Perm.R | Perm.W
4251 RX = Perm.R | Perm.X
4252 WX = Perm.W | Perm.X
4253 RWX = Perm.R | Perm.W | Perm.X
4254 values = list(Perm) + [RW, RX, WX, RWX, Perm(0)]
4255 for i in values:
4256 self.assertEqual(~i, (~i).value)
4257 self.assertIs(type(~i), Perm)
4258 self.assertEqual(~~i, i)
4259 for i in Perm:
4260 self.assertIs(~~i, i)
4261 Open = self.Open
4262 self.assertIs(Open.WO & ~Open.WO, Open.RO)
4263 self.assertIs((Open.WO|Open.CE) & ~Open.WO, Open.CE)
4264
4265 def test_boundary(self):
4266 self.assertIs(enum.IntFlag._boundary_, KEEP)

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