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

Method test_programatic_function_from_dict

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

Source from the content-addressed store, hash-verified

4379 self.assertIs(type(e), Perm)
4380
4381 def test_programatic_function_from_dict(self):
4382 Perm = IntFlag('Perm', OrderedDict((('R', 2), ('W', 8), ('X', 32))))
4383 lst = list(Perm)
4384 self.assertEqual(len(lst), len(Perm))
4385 self.assertEqual(len(Perm), 3, Perm)
4386 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
4387 for i, n in enumerate('R W X'.split()):
4388 v = 1<<(2*i+1)
4389 e = Perm(v)
4390 self.assertEqual(e.value, v)
4391 self.assertEqual(type(e.value), int)
4392 self.assertEqual(e, v)
4393 self.assertEqual(e.name, n)
4394 self.assertIn(e, Perm)
4395 self.assertIs(type(e), Perm)
4396
4397
4398 def test_programatic_function_from_empty_list(self):

Callers

nothing calls this directly

Calls 9

IntFlagClass · 0.90
OrderedDictClass · 0.90
listClass · 0.85
enumerateFunction · 0.85
assertInMethod · 0.80
PermClass · 0.70
assertEqualMethod · 0.45
splitMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected