Exemplo n.º 1
0
    def test_reset(self):

        Control.reset()
        # Validate...
        a, b, path = Control.get_last_set_data()
        self.assertFalse(a)
        self.assertFalse(b)
        self.assertEqual(Control.num_paths(), path)
Exemplo n.º 2
0
    def test_stop(self):

        Control.stop(1)
        # Validate...
        a, b, path = Control.get_last_set_data()
        self.assertFalse(a)
        self.assertFalse(b)
        self.assertEqual(1, path)
Exemplo n.º 3
0
    def test_red_amber(self):

        Control.red_amber(1)
        # Validate...
        a, b, path = Control.get_last_set_data()
        self.assertFalse(a)
        self.assertTrue(b)
        self.assertEqual(1, path)
Exemplo n.º 4
0
    def test_go(self):

        Control.go(1)
        # Validate...
        a, b, path = Control.get_last_set_data()
        self.assertTrue(a)
        self.assertTrue(b)
        self.assertEqual(1, path)
    def test_stop(self):

        controller_one = PathController.PathController(2)
        controller_one.start()

        # Trigger the change...
        controller_one.stop()

        # Wait...
        controller_one.wait(10)
        # Validate...
        a, b, path = Control.get_last_set_data()
        self.assertFalse(a)
        self.assertFalse(b)
        self.assertEqual(2, path)

        # Terminate...
        controller_one.terminate()
        controller_one.join()