コード例 #1
0
 def testUpdateSuperGlobal(self):
     self.testCreateSuperGlobal()
     sg = SuperGlobal()
     sg.i2 = 2
     sg.s2 = "s2"
     self.assertEqual(sg.i1, 1)
     self.assertEqual(sg.s1, "s1")
     self.assertEqual(sg.i2, 2)
     self.assertEqual(sg.s2, "s2")
     sg2 = SuperGlobal()
     sg2.i1 = 11
     sg2.s1 = "s11"
     self.assertEqual(sg.i1, 11)
     self.assertEqual(sg.s1, "s11")
     self.assertEqual(sg.i2, 2)
     self.assertEqual(sg.s2, "s2")
コード例 #2
0
 def testCreateSuperGlobal(self):
     sg = SuperGlobal()
     sg.i1 = 1
     sg.s1 = "s1"
     self.assertEqual(sg.i1, 1)
     self.assertEqual(sg.s1, "s1")