示例#1
0
 def test_deepcopy(self):
     c1 = Config()
     c1.Foo.bar = 10
     c1.Foo.bam = 30
     c1.a = 'asdf'
     c1.b = range(10)
     import copy
     c2 = copy.deepcopy(c1)
     self.assertEqual(c1, c2)
     self.assertTrue(c1 is not c2)
     self.assertTrue(c1.Foo is not c2.Foo)
示例#2
0
 def test_deepcopy(self):
     c1 = Config()
     c1.Foo.bar = 10
     c1.Foo.bam = 30
     c1.a = 'asdf'
     c1.b = range(10)
     import copy
     c2 = copy.deepcopy(c1)
     self.assertEquals(c1, c2)
     self.assert_(c1 is not c2)
     self.assert_(c1.Foo is not c2.Foo)
示例#3
0
 def test_deepcopy(self):
     c1 = Config()
     c1.Foo.bar = 10
     c1.Foo.bam = 30
     c1.a = 'asdf'
     c1.b = range(10)
     c1.Test.logger = logging.Logger('test')
     c1.Test.get_logger = logging.getLogger('test')
     c2 = copy.deepcopy(c1)
     self.assertEqual(c1, c2)
     self.assertTrue(c1 is not c2)
     self.assertTrue(c1.Foo is not c2.Foo)
     self.assertTrue(c1.Test is not c2.Test)
     self.assertTrue(c1.Test.logger is c2.Test.logger)
     self.assertTrue(c1.Test.get_logger is c2.Test.get_logger)
示例#4
0
 def test_deepcopy(self):
     c1 = Config()
     c1.Foo.bar = 10
     c1.Foo.bam = 30
     c1.a = 'asdf'
     c1.b = range(10)
     c1.Test.logger = logging.Logger('test')
     c1.Test.get_logger = logging.getLogger('test')
     c2 = copy.deepcopy(c1)
     self.assertEqual(c1, c2)
     self.assertTrue(c1 is not c2)
     self.assertTrue(c1.Foo is not c2.Foo)
     self.assertTrue(c1.Test is not c2.Test)
     self.assertTrue(c1.Test.logger is c2.Test.logger)
     self.assertTrue(c1.Test.get_logger is c2.Test.get_logger)
示例#5
0
 def test_setget(self):
     c = Config()
     c.a = 10
     self.assertEqual(c.a, 10)
     self.assertEqual('b' in c, False)
示例#6
0
 def test_setget(self):
     c = Config()
     c.a = 10
     self.assertEquals(c.a, 10)
     self.assertEquals(c.has_key('b'), False)
示例#7
0
 def test_setget(self):
     c = Config()
     c.a = 10
     self.assertEquals(c.a, 10)
     self.assertEquals(c.has_key('b'), False)
示例#8
0
 def test_setget(self):
     c = Config()
     c.a = 10
     self.assertEqual(c.a, 10)
     self.assertEqual('b' in c, False)