class TestToyRobotWithoutPosition(unittest.TestCase):
    def setUp(self):
        self.toy_robot = ToyRobot()

    def test_commands_while_position_is_not_set(self):
        self.toy_robot.move()
        self.toy_robot.rotate_right()
        self.toy_robot.rotate_left()
        self.assertIsNone(self.toy_robot.position)
class TestToyRobotPosition(unittest.TestCase):
    def setUp(self):
        self.toy_robot = ToyRobot()
        self.toy_robot.set_position(0, 0, 'EAST')

    def test_rotate_left(self):
        self.toy_robot.rotate_left()
        self.assertEqual(self.toy_robot.position.direction, 'NORTH')

    def test_rotate_right(self):
        self.toy_robot.rotate_right()
        self.assertEqual(self.toy_robot.position.direction, 'SOUTH')

    def test_set_position(self):
        self.assertEqual(self.toy_robot.position.x, 0)
        self.assertEqual(self.toy_robot.position.y, 0)
        self.assertEqual(self.toy_robot.position.direction, 'EAST')