Example #1
0
 def test_knight_move(self):
     knight = Knight('white')
     self.assertTrue(knight.can_move('d4', 'b5'))
     self.assertTrue(knight.can_move('d4', 'c6'))
     self.assertTrue(knight.can_move('d4', 'e6'))
     self.assertTrue(knight.can_move('d4', 'f5'))
     self.assertTrue(knight.can_move('d4', 'b3'))
     self.assertTrue(knight.can_move('d4', 'c2'))
     self.assertTrue(knight.can_move('d4', 'e2'))
     self.assertTrue(knight.can_move('d4', 'f3'))
Example #2
0
 def test_fail_knight_move(self):
     knight = Knight('white')
     self.assertFalse(knight.can_move('d4', 'd3'))
     self.assertFalse(knight.can_move('d4', 'b2'))
     self.assertFalse(knight.can_move('d4', 'd1'))
     self.assertFalse(knight.can_move('d4', 'h8'))