예제 #1
0
  def setUp(self):
    self.player    = Player("Wat", (2, 2))
    self.direction = DIRECTIONS.north

    self.player.direction = DIRECTIONS.south

    self.move = Move(self.player, self.direction)
예제 #2
0
class TestMoveLeftToAWall(unittest.TestCase):
  def setUp(self):
    self.player    = Player("Wat", (3, 2))
    self.direction = DIRECTIONS.east

    self.player.direction = DIRECTIONS.south

    self.move = Move(self.player, self.direction)

  def test_is_valid(self):
    self.assertTrue(self.move.is_valid())
예제 #3
0
  def setUp(self):
    self.game      = Game()
    self.player    = Player("Wat", (2, 2))
    self.direction = DIRECTIONS.south

    self.player.direction = DIRECTIONS.south

    self.game.player1             = self.player
    self.game.arena.space[(2, 3)] = self.player

    self.move = Move(self.player, self.direction)
예제 #4
0
class TestMoveBackward(unittest.TestCase):
  def setUp(self):
    self.player    = Player("Wat", (2, 2))
    self.direction = DIRECTIONS.north

    self.player.direction = DIRECTIONS.south

    self.move = Move(self.player, self.direction)

  def test_is_valid(self):
    self.assertFalse(self.move.is_valid())
예제 #5
0
class TestMoveRightToAnEmptySpace(unittest.TestCase):
  def setUp(self):
    self.player    = Player("Wat", (2, 2))
    self.direction = DIRECTIONS.west

    self.player.direction = DIRECTIONS.south

    self.move = Move(self.player, self.direction)

  def test_is_valid(self):
    self.assertTrue(self.move.is_valid())
예제 #6
0
class TestMoveForwardToAClaimedSpace(unittest.TestCase):
  def setUp(self):
    self.game      = Game()
    self.player    = Player("Wat", (2, 2))
    self.direction = DIRECTIONS.south

    self.player.direction = DIRECTIONS.south

    self.game.player1             = self.player
    self.game.arena.space[(2, 3)] = self.player

    self.move = Move(self.player, self.direction)

  def test_is_valid(self):
    self.assertTrue(self.move.is_valid())