MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_parse_enum_value

Method test_parse_enum_value

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

Source from the content-addressed store, hash-verified

1007 BLUE = "blue"
1008
1009 def test_parse_enum_value(self):
1010 parser = argparse.ArgumentParser()
1011 parser.add_argument('--color', choices=self.Color)
1012 args = parser.parse_args(['--color', 'red'])
1013 self.assertEqual(args.color, self.Color.RED)
1014
1015 @force_not_colorized
1016 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