def test_board2(self):
     ans = ['______W_',
            '_______B',
            '________',
            '________',
            '________',
            '________',
            '________',
            '________']
     self.assertEqual(ans, board((0, 6), (1, 7)))
 def test_board1(self):
     ans = ['________',
            '________',
            '___W____',
            '________',
            '________',
            '______B_',
            '________',
            '________']
     self.assertEqual(ans, board((2, 3), (5, 6)))
 def test_board2(self):
     ans = ['______W_',
            '_______B',
            '________',
            '________',
            '________',
            '________',
            '________',
            '________']
     self.assertEqual(board((0, 6), (1, 7)), ans)
 def test_board1(self):
     ans = ['________',
            '________',
            '___W____',
            '________',
            '________',
            '______B_',
            '________',
            '________']
     self.assertEqual(board((2, 3), (5, 6)), ans)
 def test_board1(self):
     ans = [
         '00000000', '00000000', '000W0000', '00000000', '00000000',
         '000000B0', '00000000', '00000000'
     ]
     self.assertEqual(ans, board((2, 3), (5, 6)))
 def test_queens_same_position_board(self):
     with self.assertRaises(ValueError):
         board((2, 2), (2, 2))
 def test_invalid_position_board(self):
     with self.assertRaises(ValueError):
         board((0, 0), (7, 8))
 def test_board2(self):
     ans = [
         '000000W0', '0000000B', '00000000', '00000000', '00000000',
         '00000000', '00000000', '00000000'
     ]
     self.assertEqual(ans, board((0, 6), (1, 7)))
Beispiel #9
0
 def test_queen_invalid_column(self):
     with self.assertRaises(ValueError):
         board((1, 1), (4, 8))
Beispiel #10
0
 def test_queen_negative_column(self):
     with self.assertRaises(ValueError):
         board((1, 1), (2, -2))
Beispiel #11
0
 def test_queen_invalid_row(self):
     with self.assertRaises(ValueError):
         board((1, 1), (8, 4))
Beispiel #12
0
 def test_queen_negative_row(self):
     with self.assertRaises(ValueError):
         board((1, 1), (-2, 2))
 def test_board1(self):
     ans = ['00000000', '00000000', '000W0000', '00000000',
            '00000000', '000000B0', '00000000', '00000000']
     self.assertEqual(ans, board((2, 3), (5, 6)))
 def test_board2(self):
     ans = ['000000W0', '0000000B', '00000000', '00000000',
            '00000000', '00000000', '00000000', '00000000']
     self.assertEqual(ans, board((0, 6), (1, 7)))
 def test_invalid_position_board(self):
     with self.assertRaises(ValueError):
         board((0, 0), (7, 8))
 def test_queens_same_position_board(self):
     with self.assertRaises(ValueError):
         board((2, 2), (2, 2))
Beispiel #17
0
 def test_queen_valid_position(self):
     try:
         board((1, 1), (2, 2))
     except ValueError:
         self.fail("Unexpected Exception")