Source

pygamegsoc12 / alchemymadness / test_blocks.py

Diff from to

File alchemymadness/test_blocks.py

         g = blocks.Grid()
         
 
-        self.assertEqual(len(g.grid), g.GRID_SIZE)
-        self.assertEqual(len(g.grid[0]), g.GRID_SIZE)
+        self.assertEqual(len(g.grid), g.GRID_SIZE_H)
+        self.assertEqual(len(g.grid[0]), g.GRID_SIZE_W)
         self.assertEqual(g.grid[0][0], (0,0,0))
         self.assertTrue(1 == 1)
 
+    def test_Blocks(self):
+        g = blocks.Grid()
+        
+        b = blocks.Blocks()
+        for x in range(g.GRID_SIZE_H*2):
+            b.action_move_up()
+        self.assertEqual(b.grid_positions[0][1], 0)
+
+        for x in range(g.GRID_SIZE_H*2):
+            b.action_move_down()
+        self.assertEqual(b.grid_positions[0][1], g.GRID_SIZE_H-1)
+
 if __name__ == '__main__':
     unittest.main()