コード例 #1
0
 def test_auto_section(self):
     c = Config()
     self.assertNotIn('A', c)
     assert not c._has_section('A')
     A = c.A
     A.foo = 'hi there'
     self.assertIn('A', c)
     assert c._has_section('A')
     self.assertEqual(c.A.foo, 'hi there')
     del c.A
     self.assertEqual(c.A, Config())
コード例 #2
0
ファイル: test_loader.py プロジェクト: kruger/traitlets
 def test_auto_section(self):
     c = Config()
     self.assertNotIn('A', c)
     assert not c._has_section('A')
     A = c.A
     A.foo = 'hi there'
     self.assertIn('A', c)
     assert c._has_section('A')
     self.assertEqual(c.A.foo, 'hi there')
     del c.A
     self.assertEqual(c.A, Config())