コード例 #1
0
ファイル: test_loader.py プロジェクト: Kongwtf/ipython
 def test_auto_section(self):
     c = Config()
     self.assertEqual('A' in c, True)
     self.assertEqual(c._has_section('A'), False)
     A = c.A
     A.foo = 'hi there'
     self.assertEqual(c._has_section('A'), True)
     self.assertEqual(c.A.foo, 'hi there')
     del c.A
     self.assertEqual(len(c.A.keys()),0)
コード例 #2
0
 def test_auto_section(self):
     c = Config()
     self.assertEquals(c.has_key('A'), True)
     self.assertEquals(c._has_section('A'), False)
     A = c.A
     A.foo = 'hi there'
     self.assertEquals(c._has_section('A'), True)
     self.assertEquals(c.A.foo, 'hi there')
     del c.A
     self.assertEquals(len(c.A.keys()),0)
コード例 #3
0
ファイル: test_loader.py プロジェクト: jarrodmillman/ipython
 def test_auto_section(self):
     c = Config()
     self.assertEqual("A" in c, True)
     self.assertEqual(c._has_section("A"), False)
     A = c.A
     A.foo = "hi there"
     self.assertEqual(c._has_section("A"), True)
     self.assertEqual(c.A.foo, "hi there")
     del c.A
     self.assertEqual(len(c.A.keys()), 0)
コード例 #4
0
ファイル: test_loader.py プロジェクト: ptone/ipython
 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())
コード例 #5
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())