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

Method test_programatic_function_string_list

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

Source from the content-addressed store, hash-verified

3771 self.assertIs(type(e), Perm)
3772
3773 def test_programatic_function_string_list(self):
3774 Perm = Flag('Perm', ['R', 'W', 'X'])
3775 lst = list(Perm)
3776 self.assertEqual(len(lst), len(Perm))
3777 self.assertEqual(len(Perm), 3, Perm)
3778 self.assertEqual(lst, [Perm.R, Perm.W, Perm.X])
3779 for i, n in enumerate('R W X'.split()):
3780 v = 1<<i
3781 e = Perm(v)
3782 self.assertEqual(e.value, v)
3783 self.assertEqual(type(e.value), int)
3784 self.assertEqual(e.name, n)
3785 self.assertIn(e, Perm)
3786 self.assertIs(type(e), Perm)
3787
3788 def test_programatic_function_iterable(self):
3789 Perm = Flag('Perm', (('R', 2), ('W', 8), ('X', 32)))

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