]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Test configure with string input. 2461/head
authorRey Abolofia <rabolofia@newrelic.com>
Tue, 31 Jul 2018 18:19:49 +0000 (11:19 -0700)
committerRey Abolofia <rabolofia@newrelic.com>
Tue, 31 Jul 2018 18:30:00 +0000 (11:30 -0700)
tornado/test/util_test.py

index a8c2cc094e71ed0bd5a27abc08fbe81f0e8b350d..59b13ad01ea2bff46622d8545d62a8c660b4b71d 100644 (file)
@@ -120,6 +120,18 @@ class ConfigurableTest(unittest.TestCase):
 
         self.checkSubclasses()
 
+    def test_config_str(self):
+        TestConfigurable.configure('tornado.test.util_test.TestConfig2')
+        obj = TestConfigurable()
+        self.assertIsInstance(obj, TestConfig2)
+        self.assertIs(obj.b, None)
+
+        obj = TestConfigurable(b=2)
+        self.assertIsInstance(obj, TestConfig2)
+        self.assertEqual(obj.b, 2)
+
+        self.checkSubclasses()
+
     def test_config_args(self):
         TestConfigurable.configure(None, a=3)
         obj = TestConfigurable()