def test_unidirectional(self): a = actuators.UnidirectionalActuator() self.assertEqual(a.next_move(), constants.RIGHT) a = actuators.UnidirectionalActuator(direction=None) self.assertEqual(a.next_move(), constants.RIGHT) data = a.serialize() self.assertIsNotNone(data) self.assertEqual(data["direction"], constants.RIGHT) al = actuators.UnidirectionalActuator.load(data) self.assertEqual(al.direction, constants.RIGHT) self.assertEqual(a.state, al.state)
def test_unidirectional(self): a = actuators.UnidirectionalActuator() self.assertEqual(a.next_move(), constants.RIGHT) a = actuators.UnidirectionalActuator(direction=None) self.assertEqual(a.next_move(), constants.RIGHT)