Esempio n. 1
0
    def test_waitReset(self):
        """
        Tests our wait reset functions
        """
        controller = TrafficLightController("TEST")
        self.assertEqual(controller.GetRightWait(), 0, msg="Right wait")
        controller.IncrementRightWait()
        controller.ResetRightWait()
        self.assertNotEqual(controller.GetRightWait(), 1, msg="Right wait")
        controller.ResetRightWait()
        controller.ResetRightWait()
        self.assertEqual(controller.GetRightWait(), 0, msg="Right wait")

        self.assertEqual(controller.GetOtherWait(), 0, msg="Other wait")
        controller.IncrementOtherWait()
        controller.ResetOtherWait()
        self.assertNotEqual(controller.GetOtherWait(), 1, msg="Other wait")
        controller.ResetOtherWait()
        controller.ResetOtherWait()
        self.assertEqual(controller.GetOtherWait(), 0, msg="Other wait")
Esempio n. 2
0
 def test_wait(self):
     """
     Tests our wait increment functions
     """
     controller = TrafficLightController("TEST")
     self.assertEqual(controller.GetRightWait(), 0)
     controller.IncrementRightWait()
     controller.IncrementRightWait()
     self.assertEqual(controller.GetRightWait(), 2)
     controller.ResetRightWait()
     self.assertEqual(controller.GetRightWait(), 0)