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

Method test_programatic_function_string

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

Source from the content-addressed store, hash-verified

3741 self.assertEqual(list(Open), [Open.WO, Open.RW, Open.CE])
3742
3743 def test_programatic_function_string(self):
3744 Perm = Flag('Perm', 'R W X')
3745 lst = list(Perm)
3746 self.assertEqual(len(lst), len(Perm))
3747 self.assertEqual(len(Perm), 3, Perm)
3748 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
3749 for i, n in enumerate('R W X'.split()):
3750 v = 1<<i
3751 e = Perm(v)
3752 self.assertEqual(e.value, v)
3753 self.assertEqual(type(e.value), int)
3754 self.assertEqual(e.name, n)
3755 self.assertIn(e, Perm)
3756 self.assertIs(type(e), Perm)
3757
3758 def test_programatic_function_string_with_start(self):
3759 Perm = Flag('Perm', 'R W X', start=8)

Callers

nothing calls this directly

Calls 8

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