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:3803–3816  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3801 self.assertIs(type(e), Perm)
3802
3803 def test_programatic_function_from_dict(self):
3804 Perm = Flag('Perm', OrderedDict((('R', 2), ('W', 8), ('X', 32))))
3805 lst = list(Perm)
3806 self.assertEqual(len(lst), len(Perm))
3807 self.assertEqual(len(Perm), 3, Perm)
3808 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
3809 for i, n in enumerate('R W X'.split()):
3810 v = 1<<(2*i+1)
3811 e = Perm(v)
3812 self.assertEqual(e.value, v)
3813 self.assertEqual(type(e.value), int)
3814 self.assertEqual(e.name, n)
3815 self.assertIn(e, Perm)
3816 self.assertIs(type(e), Perm)
3817
3818 @reraise_if_not_enum(
3819 FlagStooges,

Callers

nothing calls this directly

Calls 9

FlagClass · 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