示例#1
0
文件: test.py 项目: enockseth/udacity
 def test_multiple_motions(self):
     bot = Robot(world=self.world)
     self.assertEqual(self.world, 
                      bot.move(self.world, 
                               [[1, 0], [0, 1], [-1, 0], [0, -1]]))
示例#2
0
文件: test.py 项目: enockseth/udacity
 def test_move_up_left(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 1]], 
                      bot.move(self.world, [-1, -1]))
示例#3
0
文件: test.py 项目: enockseth/udacity
 def test_move_down_right(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0],
                       [0, 1, 0, 0, 0],
                       [0, 0, 0, 0, 0]], 
                      bot.move(self.world, [1, 1]))
示例#4
0
文件: test.py 项目: enockseth/udacity
 def test_stand_still(self):
     bot = Robot(world=self.world)
     self.assertEqual([[1, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0]],
                      bot.move(self.world, [0, 0]))
示例#5
0
文件: test.py 项目: enockseth/udacity
 def test_move_up(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0],
                       [0, 0, 0, 0, 0],
                       [1, 0, 0, 0, 0]], 
                      bot.move(self.world, [-1, 0]))
示例#6
0
文件: test.py 项目: eokyere/udacity
 def test_multiple_motions(self):
     bot = Robot(world=self.world)
     self.assertEqual(
         self.world, bot.move(self.world,
                              [[1, 0], [0, 1], [-1, 0], [0, -1]]))
示例#7
0
文件: test.py 项目: eokyere/udacity
 def test_move_down_right(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 0]],
                      bot.move(self.world, [1, 1]))
示例#8
0
文件: test.py 项目: eokyere/udacity
 def test_move_up_left(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 1]],
                      bot.move(self.world, [-1, -1]))
示例#9
0
文件: test.py 项目: eokyere/udacity
 def test_move_up(self):
     bot = Robot(world=self.world)
     self.assertEqual([[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [1, 0, 0, 0, 0]],
                      bot.move(self.world, [-1, 0]))
示例#10
0
文件: test.py 项目: eokyere/udacity
 def test_stand_still(self):
     bot = Robot(world=self.world)
     self.assertEqual([[1, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]],
                      bot.move(self.world, [0, 0]))