Ejemplo n.º 1
0
    def test_should_enforce_lower_boundary_on_steering(self):
        subject = Command()

        # test just above the upper bound to make sure it does throw an exception
        self.assertRaises(Exception, lambda: subject.set_steering(-1.1))

        # test the upper bound to make sure it does not throw an exception
        subject.set_steering(-1.0)
Ejemplo n.º 2
0
    def test_setters_work(self):
        subject = Command(0.1, 0.2)
        subject.set_steering(0.3)
        subject.set_throttle(0.4)

        self.assertEqual(0.3, subject.values['steering'])
        self.assertEqual(0.4, subject.values['throttle'])

        subject.set_steering(0.5)
        subject.set_throttle(0.6)
        self.assertEqual(0.5, subject.values['steering'])
        self.assertEqual(0.6, subject.values['throttle'])