Exemplo n.º 1
0
 def testSetNamedresult(self):
     namedresult = pg.get_namedresult()
     try:
         pg.set_namedresult(None)
         r = pg.get_namedresult()
         self.assertIsNone(r)
         f = lambda q: q.getresult()
         pg.set_namedresult(f)
         r = pg.get_namedresult()
         self.assertIs(r, f)
         self.assertRaises(TypeError, pg.set_namedresult, 'invalid')
     finally:
         pg.set_namedresult(namedresult)
     r = pg.get_namedresult()
     self.assertIs(r, namedresult)
Exemplo n.º 2
0
 def testSetNamedresult(self):
     namedresult = pg.get_namedresult()
     try:
         pg.set_namedresult(None)
         r = pg.get_namedresult()
         self.assertIsNone(r)
         f = lambda q: q.getresult()
         pg.set_namedresult(f)
         r = pg.get_namedresult()
         self.assertIs(r, f)
         self.assertRaises(TypeError, pg.set_namedresult, 'invalid')
     finally:
         pg.set_namedresult(namedresult)
     r = pg.get_namedresult()
     self.assertIs(r, namedresult)
Exemplo n.º 3
0
 def testGetNamedresult(self):
     r = pg.get_namedresult()
     self.assertTrue(callable(r))
     self.assertIs(r, pg._namedresult)
Exemplo n.º 4
0
 def testGetNamedresult(self):
     r = pg.get_namedresult()
     self.assertTrue(callable(r))
     self.assertIs(r, pg._namedresult)