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

Method test_config_args

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

Source from the content-addressed store, hash-verified

142 self.checkSubclasses()
143
144 def test_config_args(self):
145 TestConfigurable.configure(None, a=3)
146 obj = cast(TestConfig1, TestConfigurable())
147 self.assertIsInstance(obj, TestConfig1)
148 self.assertEqual(obj.a, 3)
149
150 obj = cast(TestConfig1, TestConfigurable(42, a=4))
151 self.assertIsInstance(obj, TestConfig1)
152 self.assertEqual(obj.a, 4)
153 self.assertEqual(obj.pos_arg, 42)
154
155 self.checkSubclasses()
156 # args bound in configure don't apply when using the subclass directly
157 obj = TestConfig1()
158 self.assertIsNone(obj.a)
159
160 def test_config_class_args(self):
161 TestConfigurable.configure(TestConfig2, b=5)

Callers

nothing calls this directly

Calls 4

checkSubclassesMethod · 0.95
TestConfigurableClass · 0.85
TestConfig1Class · 0.85
configureMethod · 0.45

Tested by

no test coverage detected