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

Method test_mixed_defaults_pre

Lib/test/test_optparse.py:496–507  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

494 self.assertEqual(self.parser.get_default_values(), self.expected)
495
496 def test_mixed_defaults_pre(self):
497 self.parser.set_defaults(x="barf", y="blah")
498 self.parser.add_option("-x", default="frob")
499 self.parser.add_option("-y")
500
501 self.expected.update({'x': "frob", 'y': "blah"})
502 self.assertEqual(self.parser.get_default_values(), self.expected)
503
504 self.parser.remove_option("-y")
505 self.parser.add_option("-y", default=None)
506 self.expected.update({'y': None})
507 self.assertEqual(self.parser.get_default_values(), self.expected)
508
509 def test_process_default(self):
510 self.parser.option_class = DurationOption

Callers

nothing calls this directly

Calls 6

get_default_valuesMethod · 0.80
set_defaultsMethod · 0.45
add_optionMethod · 0.45
updateMethod · 0.45
assertEqualMethod · 0.45
remove_optionMethod · 0.45

Tested by

no test coverage detected