MCPcopy
hub / github.com/tornadoweb/tornado / test_config_class_args

Method test_config_class_args

tornado/test/util_test.py:160–174  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

158 self.assertIsNone(obj.a)
159
160 def test_config_class_args(self):
161 TestConfigurable.configure(TestConfig2, b=5)
162 obj = cast(TestConfig2, TestConfigurable())
163 self.assertIsInstance(obj, TestConfig2)
164 self.assertEqual(obj.b, 5)
165
166 obj = cast(TestConfig2, TestConfigurable(42, b=6))
167 self.assertIsInstance(obj, TestConfig2)
168 self.assertEqual(obj.b, 6)
169 self.assertEqual(obj.pos_arg, 42)
170
171 self.checkSubclasses()
172 # args bound in configure don't apply when using the subclass directly
173 obj = TestConfig2()
174 self.assertIsNone(obj.b)
175
176 def test_config_multi_level(self):
177 TestConfigurable.configure(TestConfig3, a=1)

Callers

nothing calls this directly

Calls 4

checkSubclassesMethod · 0.95
TestConfigurableClass · 0.85
TestConfig2Class · 0.85
configureMethod · 0.45

Tested by

no test coverage detected