Example #1
0
 def __iter__(self):
     try:
         # Reset the session.
         LaunchpadLayer.resetSessionDb()
         # Yield control to asyncore for a second, just to be a
         # little bit nice.  We could be even nicer by moving this
         # whole teardown/setup dance to a thread and waiting for
         # it to be done, but there's not a (known) compelling need
         # for that right now, and doing it this way is slightly
         # simpler.
         yield ''
         DatabaseLayer.testSetUp()
         yield ''
         # Reset the librarian.
         LibrarianLayer.testTearDown()
         yield ''
         # Reset the database.
         DatabaseLayer.testTearDown()
         yield ''
         LibrarianLayer.testSetUp()
     except (SystemExit, KeyboardInterrupt):
         raise
     except:
         print "Hm, serious error when trying to clean up the test."
         traceback.print_exc()
     # We're done, so we can yield the body.
     yield '\n'
Example #2
0
 def setUp(self):
     self.sdc = PGSessionDataContainer()
     LaunchpadLayer.resetSessionDb()
     self.request = TestRequest()
     newInteraction(self.request)