MCPcopy Create free account
hub / github.com/EasyIME/PIME / test_group_dict

Method test_group_dict

python/python3/tornado/test/options_test.py:162–174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

160 self.assertEqual(expected, options.as_dict())
161
162 def test_group_dict(self):
163 options = OptionParser()
164 options.define("a", default=1)
165 options.define("b", group="b_group", default=2)
166
167 frame = sys._getframe(0)
168 this_file = frame.f_code.co_filename
169 self.assertEqual(set(["b_group", "", this_file]), options.groups())
170
171 b_group_dict = options.group_dict("b_group")
172 self.assertEqual({"b": 2}, b_group_dict)
173
174 self.assertEqual({}, options.group_dict("nonexistent"))
175
176 def test_mock_patch(self):
177 # ensure that our setattr hooks don't interfere with mock.patch

Callers

nothing calls this directly

Calls 4

defineMethod · 0.95
groupsMethod · 0.95
group_dictMethod · 0.95
OptionParserClass · 0.90

Tested by

no test coverage detected