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

Method test_parse_enum_value

Lib/test/test_argparse.py:1108–1112  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1106 BLUE = "blue"
1107
1108 def test_parse_enum_value(self):
1109 parser = argparse.ArgumentParser()
1110 parser.add_argument('--color', choices=self.Color)
1111 args = parser.parse_args(['--color', 'red'])
1112 self.assertEqual(args.color, self.Color.RED)
1113
1114 @force_not_colorized
1115 def test_help_message_contains_enum_choices(self):

Callers

nothing calls this directly

Calls 3

parse_argsMethod · 0.95
add_argumentMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected