コード例 #1
0
ファイル: go_counting_test.py プロジェクト: jang93/exercism
 def test_black_corner_territory_on_5x5_board(self):
     board = Board(["  B  ", " B B ", "B W B", " W W ", "  W  "])
     stone, territory = board.territory(x=0, y=1)
     self.assertEqual(stone, BLACK)
     self.assertSetEqual(territory, {(0, 0), (0, 1), (1, 0)})
コード例 #2
0
ファイル: go_counting_test.py プロジェクト: jang93/exercism
 def test_invalid_because_y_is_too_high_for_5x5_board(self):
     board = Board(["  B  ", " B B ", "B W B", " W W ", "  W  "])
     with self.assertRaisesWithMessage(ValueError):
         board.territory(x=1, y=5)
コード例 #3
0
ファイル: go_counting_test.py プロジェクト: jang93/exercism
 def test_a_stone_and_not_a_territory_on_5x5_board(self):
     board = Board(["  B  ", " B B ", "B W B", " W W ", "  W  "])
     stone, territory = board.territory(x=1, y=1)
     self.assertEqual(stone, NONE)
     self.assertSetEqual(territory, set())
コード例 #4
0
ファイル: go_counting_test.py プロジェクト: jang93/exercism
 def test_open_corner_territory_on_5x5_board(self):
     board = Board(["  B  ", " B B ", "B W B", " W W ", "  W  "])
     stone, territory = board.territory(x=1, y=4)
     self.assertEqual(stone, NONE)
     self.assertSetEqual(territory, {(0, 3), (0, 4), (1, 4)})
コード例 #5
0
ファイル: go_counting_test.py プロジェクト: jang93/exercism
 def test_white_center_territory_on_5x5_board(self):
     board = Board(["  B  ", " B B ", "B W B", " W W ", "  W  "])
     stone, territory = board.territory(x=2, y=3)
     self.assertEqual(stone, WHITE)
     self.assertSetEqual(territory, {(2, 3)})
コード例 #6
0
 def test_invalid_because_y_is_too_high_for_5x5_board(self):
     board = Board(["  B  ", " B B ", "B W B", " W W ", "  W  "])
     with self.assertRaises(ValueError) as err:
         board.territory(x=1, y=5)
     self.assertEqual(type(err.exception), ValueError)
     self.assertEqual(err.exception.args[0], "Invalid coordinate")