import unittest

from robot import Robot

class Test_Robot(unittest.TestCase):
    def test_basic_turning(self):
        r = Robot("Tesla")
        r.left()
        self.assertEqual(3, r.heading)
        r.left()
        self.assertEqual(2, r.heading)
        r.right()
        r.right()
        self.assertEqual(0, r.heading)

    def test_basic_movement(self):
        r = Robot("Tesla")
        x, y = r.pos
        r.forward()
        self.assertEqual((x, y - 1), r.pos)

        x, y = r.pos
        r.left()
        r.forward()
        self.assertEqual((x - 1, y), r.pos)

    def test_simple_grid(self):
        r = Robot("Tesla", Simple_Grid(3))
        pos = r.x, r.y
        r.forward()
        self.assertEqual(pos, r.pos)

if __name__ == "__main__":
    unittest.main()

@@ -33,16 +33,46 @@
 rt Robot
+%0Afrom grids import Simple_Grid
 %0A%0Aclass 
@@ -756,16 +756,111 @@
 , r.pos)
+%0A        r.backward()%0A        r.left()%0A        r.forward()%0A        self.assertEqual(pos, r.pos)
 %0A%0Aif __n

check bounds on 2 planes