def my_reg_setup():
    """make sure we are all setup to test reservations"""
    if initA.unregister() != 0:
        initA.unregister()
    if initB.unregister() != 0:
        initB.unregister()
    initC.runTur()
 def testMainHolderUnregisterDoesNotReleasesReservation(self):
     resvnA = initA.getReservation()
     self.assertEqual(resvnA.key, ar_key)
     self.assertEqual(resvnA.getRtypeNum(), my_rtype)
     res = initA.unregister()
     self.assertEqual(res, 0)
     resvnA = initA.getReservation()
     self.assertEqual(resvnA.key, ar_key)
     self.assertEqual(resvnA.getRtypeNum(), my_rtype)
 def testReservationHolderUnregisterReleasesReservation(self):
     resvnA = initA.getReservation()
     self.assertEqual(resvnA.key, initA.key)
     self.assertEqual(resvnA.getRtypeNum(), my_rtype)
     res = initA.unregister()
     self.assertEqual(res, 0)
     resvnA = initA.getReservation()
     self.assertEqual(resvnA.key, None)
     self.assertEqual(resvnA.rtype, None)
 def testCanUnregister(self):
     res = initA.unregister()
     self.assertEqual(res, 0)
     registrants = initA.getRegistrants()
     self.assertEqual(len(registrants), 1)
     res = initB.unregister()
     self.assertEqual(res, 0)
     registrants = initB.getRegistrants()
     self.assertEqual(len(registrants), 0)